|
-
July 25th, 1999, 05:54 AM
#1
Region
Hello,
I would like to create a region from a bitmap. How can I do this in VB?
Thanks a lot
Nathalie
-
July 29th, 1999, 09:59 AM
#2
Re: Region
As far as I know you don't create a region FROM anything except coordinate points. You can create a region and select a bitmap into it though easily.
Call CreateRectRgn
rec=CreateRectRgn(Left, Top, Right, Bottom)
Select the region into a DC
oldDC=SelectClipRgn(Form1.hdc, rec)
Then just blit the bitmap onto the DC at the regions coordinates. When you select the region into the DC, the region accepts the blit, like the region takes over the whole DC. So if your blit runs outside of the region the excess area is clipped.
Lastly, clean up
rec=SelectClipRgn(Form1.hdc,oldDC)
DeleteObject rec
You can also use DrawEdge to give the Bitmap a sunken or raised 3d effect.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|