Button Bitmap load is slow

Rusty

Well-Known Member
Licensed User
Longtime User
I am creating buttons with .PNG background images programmatically and the load times seem inordinately long as compared to creating the same buttons with text only. Is there a method to speed up graphics loads into buttons?
rc is defined above in code as
...
Type RowCol (Row As Int, Col As Int, TradeId As Int, ParentTradeId As Int, Range As Int, Name As String, ImageURL As String)
...
Dim l As Button
l.Initialize("cell")
l.Gravity = alignment

If rc.ImageURL.Trim <> "" Then
Dim BG As BitmapDrawable
bg.Initialize(LoadBitmap(File.DirAssets, rc.ImageURL))
l.Background = bg
Else
l.Text = rc.Name
l.TextSize = fontsize
l.TextColor = fontcolor
End If
l.Tag = rc
 

Rusty

Well-Known Member
Licensed User
Longtime User
Bitmap loads slowly

Thanks for the fast response
They are all about 25K, .PNG's.
I changed it to the loadbitmapsample and restricted the width and height.
Still very slow. Maybe it is the emulator...
 
Upvote 0
Top