H hackhack Active Member Licensed User Longtime User Sep 20, 2011 #1 I have an imageview with a picture. I have a PNG with transparent areas, is it possible to overlay on the imageview? (ie, really compose the two, keeping the new areas from the PNG and respecting the transparent areas)
I have an imageview with a picture. I have a PNG with transparent areas, is it possible to overlay on the imageview? (ie, really compose the two, keeping the new areas from the PNG and respecting the transparent areas)
Djembefola Active Member Licensed User Longtime User Sep 20, 2011 #2 you can do it with the .drawbitmap method of the canvas object Code: Copy dim cnv as canvas cnv.initialize(myimageview) cnv.drawbitmap(... Upvote 0
you can do it with the .drawbitmap method of the canvas object Code: Copy dim cnv as canvas cnv.initialize(myimageview) cnv.drawbitmap(...
H hackhack Active Member Licensed User Longtime User Sep 20, 2011 #4 Can't get it to work, it just crashes. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 20, 2011 #5 What is the error message? Upvote 0
H hackhack Active Member Licensed User Longtime User Sep 20, 2011 #6 It was a NullPointerException, apparently you can't draw on the imageview until it has been AddView'ed to something else. However even though the source files are the same size the copy looks bigger (when placed on the other picture) Can I resize a bitmap with transparencies (png source) and have the transparent areas remain or will they disappear? Upvote 0
It was a NullPointerException, apparently you can't draw on the imageview until it has been AddView'ed to something else. However even though the source files are the same size the copy looks bigger (when placed on the other picture) Can I resize a bitmap with transparencies (png source) and have the transparent areas remain or will they disappear?
thedesolatesoul Expert Licensed User Longtime User Sep 20, 2011 #7 Transparent areas will remain. Do you know why they are drawn different sizes? Maybe using different methods to draw them? Upvote 0
Transparent areas will remain. Do you know why they are drawn different sizes? Maybe using different methods to draw them?
H hackhack Active Member Licensed User Longtime User Sep 20, 2011 #8 thedesolatesoul said: Transparent areas will remain. Do you know why they are drawn different sizes? Maybe using different methods to draw them? Click to expand... Well, the first is placed in an imageview, then i use the canvas to copy the second image on the first one. Upvote 0
thedesolatesoul said: Transparent areas will remain. Do you know why they are drawn different sizes? Maybe using different methods to draw them? Click to expand... Well, the first is placed in an imageview, then i use the canvas to copy the second image on the first one.
thedesolatesoul Expert Licensed User Longtime User Sep 20, 2011 #9 Well the one in the imageview depends on the size of the imageview. I think it will be stretched to the dimensions. The other one will depend on the size of DestRect you use to draw. If you set the size of DestRect the same as imageview dimensions they should be the same size. Upvote 0
Well the one in the imageview depends on the size of the imageview. I think it will be stretched to the dimensions. The other one will depend on the size of DestRect you use to draw. If you set the size of DestRect the same as imageview dimensions they should be the same size.
H hackhack Active Member Licensed User Longtime User Sep 21, 2011 #10 Yep, that seems to do the trick. I had set the size from the bitmap instead, thanks Upvote 0