Friday 15 April 2011

vb.net - Place a picture box inside another: VS2008 -



vb.net - Place a picture box inside another: VS2008 -

hope can help here. vb app, seek place 1 picturebox on gdi+ drawn image (or picturebox) in visual studio 2008, , picturebox includes transparent areas don't come transparent.

i have looked through many methods don't suit situation: background drawn using gdi, , app need picturebox stationary upon it. (the stationary image cant gdi+ drawn too, because background updates every while, causes disappear. tried redraw image makes ugly flickering effect).

when seek utilize picturebox background, , assign parent overlaying image transparency effect, above image doesn't show @ all. here vb code:

class="lang-vb prettyprint-override">dim picturebox dim silhouetteas picturebox dim img bitmap = new bitmap(imgpath) img.maketransparent(color.white) = new picturebox() silhouette= new picturebox() silhouette.parent = silhouette.size = new point(width, height) silhouette.location = new point(xpos, ypos) silhouette.image = img silhouette.backcolor = color.transparent back.parent = main back.size = new point(width, height) back.location = new point(xpos, ypos) back.backcolor = color.blue

where background , silhouette on-top image. can please provide illustration of how transparency achieved through parenting pictureboxes? or other solution situation?

never mind, found out wrong - when assigned picturebox parent, didn't update location of overlaying picturebox relatively. correction add:

class="lang-vb prettyprint-override">silhouette.location=new point(0,0)

forgot coordinates relative parent , not form anymore.

vb.net transparency picturebox

No comments:

Post a Comment