Event Name assigned to ImageView

WZSun

Member
Licensed User
Longtime User
Hi,
I noticed that if I assigned a different Event Name from the default (say ImageView14), it does not load the image. When run, it will prompt a message to initialise.

Does not work...
Img14.Bitmap = LoadBitmap(File.DirAssets,"s" & tmpImage1 & ".png")

Works...
ImageView14.Bitmap = LoadBitmap(File.DirAssets,"s" & tmpImage1 & ".png")

I also noticed that the filename has to be lowercase. Below statement will not work if I specify filename as "S"...

ImageView14.Bitmap = LoadBitmap(File.DirAssets,"S" & nI & ".png")

I have to change the filename to "s" and rename the actual image filename accordingly.

I remembered accessing my sql database file as well. Initially I set it to Project.db but it doesn't load. But when I renamed my db file as project.db and load it accordingly, it works.

Anyone else experienced this symptom?
 

klaus

Expert
Licensed User
Longtime User
Hi,
I noticed that if I assigned a different Event Name from the default (say ImageView14), it does not load the image. When run, it will prompt a message to initialise.

Does not work...
Img14.Bitmap = LoadBitmap(File.DirAssets,"s" & tmpImage1 & ".png")

Works...
ImageView14.Bitmap = LoadBitmap(File.DirAssets,"s" & tmpImage1 & ".png")

That's normal. You change the EventName not the view's name.
To change parameters, like a Bitmap, you must use the view's name.

Changing the EventName is useful when you want to wire events of several views to a same routine.
You can have a look here: http://www.b4x.com/forum/beta/6518-addevent-sender-etc.html

Best regards.
 
Top