O Omar Member Licensed User Longtime User Jun 1, 2011 #1 Hello, I have been facing an issue when I try to load a bitmap into an ImageView, I am using the following code: If Val(Rating) >= 8.5 Then ImageView2 = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2 = LoadBitmap(File.DirAssets, "rating40.gif") End If Sub Val(s As String) As Int If Not(IsNumber(s)) Then Return 0 Return s End Sub Click to expand... I have already added the ImageView2 in through the designer, but all I get is a blank white box. Will appreciate any help with this. Thank you.
Hello, I have been facing an issue when I try to load a bitmap into an ImageView, I am using the following code: If Val(Rating) >= 8.5 Then ImageView2 = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2 = LoadBitmap(File.DirAssets, "rating40.gif") End If Sub Val(s As String) As Int If Not(IsNumber(s)) Then Return 0 Return s End Sub Click to expand... I have already added the ImageView2 in through the designer, but all I get is a blank white box. Will appreciate any help with this. Thank you.
klaus Expert Licensed User Longtime User Jun 1, 2011 #2 You should use: Code: If Val(Rating) >= 8.5 Then ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating40.gif") End If ImageView2 is the name of the view. ImageView2.Bitmap is the parameter. Best regards. Upvote 0
You should use: Code: If Val(Rating) >= 8.5 Then ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating40.gif") End If ImageView2 is the name of the view. ImageView2.Bitmap is the parameter. Best regards.
O Omar Member Licensed User Longtime User Jun 1, 2011 #3 Thank you very much Klaus. That was exactly it. klaus said: You should use: Code: If Val(Rating) >= 8.5 Then ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating40.gif") End If ImageView2 is the name of the view. ImageView2.Bitmap is the parameter. Best regards. Click to expand... Upvote 0
Thank you very much Klaus. That was exactly it. klaus said: You should use: Code: If Val(Rating) >= 8.5 Then ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating45.gif") Else ImageView2[COLOR=red].Bitmap[/COLOR] = LoadBitmap(File.DirAssets, "rating40.gif") End If ImageView2 is the name of the view. ImageView2.Bitmap is the parameter. Best regards. Click to expand...