Evening all, have a small app that allows users to select pages from manuals by clicking on thumbnails and then scrolling through the manual by clicking arrows
the below code is not behaving as I would expect - namely the loadbitmapsample is not scaling the bitmap to fit within the specified dimensions - instead the bitmap is unscaled and chopped off at the edges.
I have attached the complete code in a text file
any ideas much appreciated - thanks
<
Sub updateimage(clickedthumb2a)
Dim tc As ImageView
Dim ths1 As ths
Dim sv1 As ScrollView
Dim pn1 As Panel
Dim cursor1 As Cursor
clearpanel2
If minthumb < clickedthumb2 Then
ImageView4.Visible = True
ImageView4.enabled = True
Else
ImageView4.visible = False
ImageView4.enabled = False
End If
If maxthumb > clickedthumb2 Then
ImageView3.visible = True
ImageView3.enabled = True
Else
ImageView3.visible = False
ImageView3.enabled = False
End If
cursor1 = sql1.ExecQuery2("select Manual, Section, Page, ID from Items where ID= ?", Array As String(clickedthumb2a))
cursor1.Position=0
manuala = cursor1.GetString("Manual")
manuala = manuala.Replace(" ","_")
sectiona = cursor1.GetString("Section")
sectiona = sectiona.Replace(" ","_")
page = cursor1.GetString("Page")
page=page.Replace(" ","_")
folderb = manuala & "/" & sectiona & "/" & page & ".jpeg"
'Log(folderb)
ths1.folderb = folderb
ths1.indexb = clickedthumb2a
cursor1.Close
If tc.IsInitialized = True Then tc.RemoveView
sv1.Initialize(1115)
pn1 = sv1.Panel
sv1.BringToFront
pn1.BringToFront
Panel2.AddView(sv1,0,0,750,470)
tc.Initialize("thumbclick")
tc.bitmap= LoadBitmapSample(File.DirRootExternal & "/docbrowser", folderb, 750, 1110)
pn1.AddView(tc,5,5,740,1100)
tc.Tag = ths1
End Sub
the below code is not behaving as I would expect - namely the loadbitmapsample is not scaling the bitmap to fit within the specified dimensions - instead the bitmap is unscaled and chopped off at the edges.
I have attached the complete code in a text file
any ideas much appreciated - thanks
<
Sub updateimage(clickedthumb2a)
Dim tc As ImageView
Dim ths1 As ths
Dim sv1 As ScrollView
Dim pn1 As Panel
Dim cursor1 As Cursor
clearpanel2
If minthumb < clickedthumb2 Then
ImageView4.Visible = True
ImageView4.enabled = True
Else
ImageView4.visible = False
ImageView4.enabled = False
End If
If maxthumb > clickedthumb2 Then
ImageView3.visible = True
ImageView3.enabled = True
Else
ImageView3.visible = False
ImageView3.enabled = False
End If
cursor1 = sql1.ExecQuery2("select Manual, Section, Page, ID from Items where ID= ?", Array As String(clickedthumb2a))
cursor1.Position=0
manuala = cursor1.GetString("Manual")
manuala = manuala.Replace(" ","_")
sectiona = cursor1.GetString("Section")
sectiona = sectiona.Replace(" ","_")
page = cursor1.GetString("Page")
page=page.Replace(" ","_")
folderb = manuala & "/" & sectiona & "/" & page & ".jpeg"
'Log(folderb)
ths1.folderb = folderb
ths1.indexb = clickedthumb2a
cursor1.Close
If tc.IsInitialized = True Then tc.RemoveView
sv1.Initialize(1115)
pn1 = sv1.Panel
sv1.BringToFront
pn1.BringToFront
Panel2.AddView(sv1,0,0,750,470)
tc.Initialize("thumbclick")
tc.bitmap= LoadBitmapSample(File.DirRootExternal & "/docbrowser", folderb, 750, 1110)
pn1.AddView(tc,5,5,740,1100)
tc.Tag = ths1
End Sub
Last edited: