Help with graphics or other?

sitajony

Active Member
Licensed User
Hi, is it possible to by example draw an image on a form and draw an other and then change the image drawed previously by an other image without remove the other image or draw over the first image?

I've only a solution but really frighten who is to redraw the background and redraw each images...

If someone have a better solution tell me, it'll be very helpful...

Thanks for your replies!
 

agraham

Expert
Licensed User
Longtime User
The obvious reply is why not draw onto separate bitmaps then just assign the one you want to the Form Image property when you need to change it. However I suspect this is not what you really want so can you explain more clearly the requirement
 

sitajony

Active Member
Licensed User
It's right, I didn't explain it clearly...:
I want to make the real transparency, when a Label is over a PictureBox we'll can see the PictureBox on the label, The only way I found is to draw this PictureBox on the background (not set it as background just draw it with the same dimension and position) but on this Form there's several PictureBox and I would like when I change the PictureBox position just redraw it but lets the others and refresh the Label who is over this PictureBox...

If it's not understable yet I'll can explain more clearly again...
Thanks for your reply!
 

agraham

Expert
Licensed User
Longtime User
If I understand right you could keep a Bitmap containing the background image of the Form and use a DrawerEx (from ImageLibEx) DrawImage to selectively erase the existing "PictureBox" area from the Form background using the reference background and then redraw the "PictureBox" at its new position.
 

sitajony

Active Member
Licensed User
but knowing that it can have another PictureBox behind the PictureBox...
I looked for DrawEx but it doesn't work as well as I want but maybe I didn't use the best way...
If it's really possible tell me...

Thanks for your reply!
 

sitajony

Active Member
Licensed User
It seems be a good way, thanks! I'm testing...

Edit:
In fact it's exactly my start idea in redrawing background and redraw each images...
There's really no other way? Otherwise I'll use it...
 
Last edited:

sitajony

Active Member
Licensed User
Ok... Coz I'm working also on Alpha image with transparency and the CPU can be full used if I use this way...
Thanks anyway, If a day I find an other way I'll tell it here...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…