#Region Project Attributes
#ApplicationLabel: Book
#VersionCode: 1
#VersionName: beta
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: true
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim s As SQL
End Sub
Sub Globals
Private ScrollView1 As ScrollView
Private Openlist As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("android")
ScrollView1.Initialize("")
Openlist.Initialize("")
If File.Exists(File.DirInternal,"db.db")=False Then
File.Copy(File.dirAssets,"db.db",File.DirInternal,"db.db")
End If
If s.IsInitialized=False Then
s.Initialize(File.DirInternal,"db.db",False)
End If
show
End Sub
Sub show
Dim sh As Int
sh=0
Dim cur As Cursor
cur=s.ExecQuery("Select * form tbl1")
Dim h As Int
h=2%y
For i = 0 To cur.RowCount-1
cur.Position = i
If cur.GetInt("type")=0 Then
Dim lbl As Label
lbl.Initialize("")
lbl.Text=cur.GetString("value")
lbl.TextSize=20
lbl.TextColor=Colors.Black
lbl.Typeface = Typeface.LoadFromAssets("Droid Arabic Kufi.TTF")
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,0,h,100%x,100%y)
img.Left=50%x-img.Width/2
h= h + bp.getHeight(img.Bitmap) + 65%y
sh= sh + bp.getHeight(img.Bitmap)
ScrollView1.Panel.Height=h
End If
Next
End Sub
Sub Namayesh(Position As String) As Bitmap
Dim cur As Cursor
cur = s.ExecQuery("SELECT value FROM tbl1")
cur.Position=Position
Dim bytes() As Byte
bytes=cur.GetBlob("value")
Dim input As InputStream
input.InitializeFromBytesArray(bytes,0,bytes.Length)
Dim b As Bitmap
b.Initialize2(input)
input.Close
Return(b)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
سوال
Negan 1,300
سلام دوستان من طبق یکی از آموزش های انجمن که با دیتابیس چند عکس رو توی اسکرول ویو قرار میداد یک برنامه ساختم
یه مشکل دارم باهاش ک موقع کامپایله
پروژه رو پیوست میکنم ببینید مرسی اگ لطف کنین بگین مشکلش چیه

عکس ارور هارو هم پیوست کردم
اینم کد پروژه
#Region Project Attributes #ApplicationLabel: Book #VersionCode: 1 #VersionName: beta 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: true #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals Dim s As SQL End Sub Sub Globals Private ScrollView1 As ScrollView Private Openlist As Button End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("android") ScrollView1.Initialize("") Openlist.Initialize("") If File.Exists(File.DirInternal,"db.db")=False Then File.Copy(File.dirAssets,"db.db",File.DirInternal,"db.db") End If If s.IsInitialized=False Then s.Initialize(File.DirInternal,"db.db",False) End If show End Sub Sub show Dim sh As Int sh=0 Dim cur As Cursor cur=s.ExecQuery("Select * form tbl1") Dim h As Int h=2%y For i = 0 To cur.RowCount-1 cur.Position = i If cur.GetInt("type")=0 Then Dim lbl As Label lbl.Initialize("") lbl.Text=cur.GetString("value") lbl.TextSize=20 lbl.TextColor=Colors.Black lbl.Typeface = Typeface.LoadFromAssets("Droid Arabic Kufi.TTF") 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,0,h,100%x,100%y) img.Left=50%x-img.Width/2 h= h + bp.getHeight(img.Bitmap) + 65%y sh= sh + bp.getHeight(img.Bitmap) ScrollView1.Panel.Height=h End If Next End Sub Sub Namayesh(Position As String) As Bitmap Dim cur As Cursor cur = s.ExecQuery("SELECT value FROM tbl1") cur.Position=Position Dim bytes() As Byte bytes=cur.GetBlob("value") Dim input As InputStream input.InitializeFromBytesArray(bytes,0,bytes.Length) Dim b As Bitmap b.Initialize2(input) input.Close Return(b) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Subمتچکرممممممممممممممممممممممممممم
Db_book2.rar
لینک ارسال
به اشتراک گذاری در سایت های دیگر
5 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.