سلام به دوستان در اسکرول ویو عکس را بطور کامل نشان نمیدهد یعنی 4 طرف ان را قطع میکند کدها را قرار دادم تعداد عکس هاهم10 تایی هست در همه همین طوره
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ScrollView1 As ScrollView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Act_2")
If File.Exists(File.DirInternal,"d1.db")=False Then
File.Copy(File.DirAssets,"d1.db",File.DirInternal,"d1.db")
End If
If s.IsInitialized=False Then
s.Initialize(File.DirInternal,"d1.db",False)
End If
Dim sh As Int
sh=0
Dim cur As Cursor
cur=s.ExecQuery("Select * FROM Tbl")
Dim h As Int
h=2%y
For i = 0 To cur.RowCount-1
cur.Position=i
If cur.GetInt("t")=0 Then
Dim lbl As Label
lbl.Initialize("")
lbl.Text=cur.GetString("i")
lbl.Gravity=Gravity.CENTER
If File.Exists(File.DirInternal,"Settings.stg")=True Then
Dim list1 As List
list1=File.ReadList(File.DirInternal,"Settings.stg")
Tanzimat2.font=list1.Get(0)
Tanzimat2.size=list1.Get(1)
Tanzimat2.color=list1.Get(2)
Else
Tanzimat2.font="font3"
Tanzimat2.size=18
lbl.TextColor=Colors.Black
End If
lbl.Typeface=Typeface.LoadFromAssets(Tanzimat2.font & ".ttf")
lbl.TextSize=Tanzimat2.size
ScrollView1.Panel.AddView(lbl,2%x,h,96%x,0)
Dim su As StringUtils
lbl.Height=su.MeasureMultilineTextHeight(lbl,lbl.Text)
h= h + lbl.Height +2%y
sh=sh+lbl.Height
ScrollView1.Panel.Height=sh
Else
Dim img As ImageView
img.Initialize("")
img.Bitmap=Namayesh(i)
Dim bp As BitmapExtended
bp.Initialize("")
ScrollView1.Panel.AddView(img,5%x,h,bp.getWidth(img.Bitmap),bp.getHeight(img.Bitmap))
h= h + bp.getHeight(img.Bitmap) + 2%y
sh=sh+bp.getHeight(img.Bitmap)
ScrollView1.Panel.Height=sh
End If
ScrollView1.Panel.Height=ScrollView1.Panel.Height+100%y
Select Case Tanzimat2.color
Case 1
lbl.TextColor=Colors.Green
Case 2
lbl.TextColor=Colors.red
Case 3
lbl.TextColor=Colors.Black
End Select
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Namayesh(Position As String) As Bitmap
Dim cur As Cursor
cur=s.ExecQuery("select i FROM Tbl")
cur.Position=Position
Dim bytes() As Byte
bytes=cur.GetBlob("i")
Dim input As InputStream
input.InitializeFromBytesArray(bytes,0,bytes.Length)
Dim b As Bitmap
b.Initialize2(input)
input.Close
Return(b)
End Sub
سوال
حسینh 50
سلام به دوستان در اسکرول ویو عکس را بطور کامل نشان نمیدهد یعنی 4 طرف ان را قطع میکند کدها را قرار دادم تعداد عکس هاهم10 تایی هست در همه همین طوره
Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Private ScrollView1 As ScrollView End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("Act_2") If File.Exists(File.DirInternal,"d1.db")=False Then File.Copy(File.DirAssets,"d1.db",File.DirInternal,"d1.db") End If If s.IsInitialized=False Then s.Initialize(File.DirInternal,"d1.db",False) End If Dim sh As Int sh=0 Dim cur As Cursor cur=s.ExecQuery("Select * FROM Tbl") Dim h As Int h=2%y For i = 0 To cur.RowCount-1 cur.Position=i If cur.GetInt("t")=0 Then Dim lbl As Label lbl.Initialize("") lbl.Text=cur.GetString("i") lbl.Gravity=Gravity.CENTER If File.Exists(File.DirInternal,"Settings.stg")=True Then Dim list1 As List list1=File.ReadList(File.DirInternal,"Settings.stg") Tanzimat2.font=list1.Get(0) Tanzimat2.size=list1.Get(1) Tanzimat2.color=list1.Get(2) Else Tanzimat2.font="font3" Tanzimat2.size=18 lbl.TextColor=Colors.Black End If lbl.Typeface=Typeface.LoadFromAssets(Tanzimat2.font & ".ttf") lbl.TextSize=Tanzimat2.size ScrollView1.Panel.AddView(lbl,2%x,h,96%x,0) Dim su As StringUtils lbl.Height=su.MeasureMultilineTextHeight(lbl,lbl.Text) h= h + lbl.Height +2%y sh=sh+lbl.Height ScrollView1.Panel.Height=sh Else Dim img As ImageView img.Initialize("") img.Bitmap=Namayesh(i) Dim bp As BitmapExtended bp.Initialize("") ScrollView1.Panel.AddView(img,5%x,h,bp.getWidth(img.Bitmap),bp.getHeight(img.Bitmap)) h= h + bp.getHeight(img.Bitmap) + 2%y sh=sh+bp.getHeight(img.Bitmap) ScrollView1.Panel.Height=sh End If ScrollView1.Panel.Height=ScrollView1.Panel.Height+100%y Select Case Tanzimat2.color Case 1 lbl.TextColor=Colors.Green Case 2 lbl.TextColor=Colors.red Case 3 lbl.TextColor=Colors.Black End Select Next End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Namayesh(Position As String) As Bitmap Dim cur As Cursor cur=s.ExecQuery("select i FROM Tbl") cur.Position=Position Dim bytes() As Byte bytes=cur.GetBlob("i") Dim input As InputStream input.InitializeFromBytesArray(bytes,0,bytes.Length) Dim b As Bitmap b.Initialize2(input) input.Close Return(b) End Subلینک ارسال
به اشتراک گذاری در سایت های دیگر
16 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.