image problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I have these in sub globals:

dim bmpcorrect as bitmap
dim imvcorrect as imageview


Under activity create , I load bmpcorrect into imvcorrect:

bmpcorrect.Initialize(File.DirAssets,"correct.png")
imvCorrect.Initialize("")
imvcorrect.Bitmap = bmpcorrect

The size of correct.png is 360x360 , this is ok with 360 x 640 (scale1) but with 320x480 it is not ok ( screen size is 320 and image size is 360) so i want load the smaller version of correct.png which is correctMini.png when the screensize is 320x480 ( scale1) in the variant file. But cant do it :(

I need a tip about this .
Thank you
 

klaus

Expert
Licensed User
Longtime User
You can check the screen dimensions with ASctivity.Width (100%x) and Activity.Height(100%y) and load the specific file.
If the imvcorrect ImageView is already defined in a laout file you must not initialize it in the code !

Best regards.
 
Upvote 0
Top