Jump to content
  • Advertisement
Sign in to follow this  
Red_falcon

[.net] Windows Forms/GDI+ Skinning

This topic is 4728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am trying to skin a windows form. I load an image file with all the needed window parts and buttons, but i couldn't cut the image in pieces. I tried it with DrawImage, but thats a bit complex to manage the parts than. Does anybody know another method? I would like to cut the image and store the pieces in different Bitmap instances in memory.

Share this post


Link to post
Share on other sites
Advertisement
OK, maybe my question was a little cryptic. If you want to save images to bitmaps that way in VB.NET:



' create your bitmap
dim bmpPiece as new bitmap(width, height)

' create a graphics object
dim BitmapGfx as graphics = Graphics.FromImage(bmpPiece)

' now get the dc using the graphics object you created...
dim BitmapHandle as intPtr

BitMapHandle = BitmapGfx.GetHdc()

' You won't see GetHdc listed as a method in the intellisense window,
' but it is there.

' now that you have the handle, use bitblt() to copy your images

' don't forget to release that dc when you are done
BitmapGfx.ReleaseHdc(BitmapHandle)


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!