Regions in GDI+
-
When creating regions in GDI+ what is returned? Creating a region in the usual GDI returns a HRGN but what is returned in GDI+? A pointer? If so can I use that pointer stored in a struct for later use? :confused:
-
When creating regions in GDI+ what is returned? Creating a region in the usual GDI returns a HRGN but what is returned in GDI+? A pointer? If so can I use that pointer stored in a struct for later use? :confused:
What is the diff. between GDI and GDI+?
-
What is the diff. between GDI and GDI+?
GDI is the base graphical system that comes with Windows XP/2K/NT/ME etc. If supports base drawing primatives and has limited image support. GDI+ is shipped as a DLL which you can use in your application for 2K/NT/ME this must be shipped with your app. (~1.6mb). What you give is rich support for images, gradient brushes, text etc. etc. The programming model also simplifies the use of GDI: EXAMPLE: WCHAR string[] = L"Draw text in a rectangle by passing a RectF to the DrawString method."; FontFamily fontFamily(L"Arial"); Font font(&fontFamily, 12, FontStyleBold, UnitPoint); RectF rectF(30.0f, 10.0f, 100.0f, 122.0f); SolidBrush solidBrush(Color(255, 0, 0, 255)); graphics.DrawString(string, -1, &font, rectF, NULL, &solidBrush); Pen pen(Color(255, 0, 0, 0)); graphics.DrawRectangle(&pen, rectF); ... GDI+ is supported by .NET by default. Normski. - Professional Windows Programmer
-
GDI is the base graphical system that comes with Windows XP/2K/NT/ME etc. If supports base drawing primatives and has limited image support. GDI+ is shipped as a DLL which you can use in your application for 2K/NT/ME this must be shipped with your app. (~1.6mb). What you give is rich support for images, gradient brushes, text etc. etc. The programming model also simplifies the use of GDI: EXAMPLE: WCHAR string[] = L"Draw text in a rectangle by passing a RectF to the DrawString method."; FontFamily fontFamily(L"Arial"); Font font(&fontFamily, 12, FontStyleBold, UnitPoint); RectF rectF(30.0f, 10.0f, 100.0f, 122.0f); SolidBrush solidBrush(Color(255, 0, 0, 255)); graphics.DrawString(string, -1, &font, rectF, NULL, &solidBrush); Pen pen(Color(255, 0, 0, 0)); graphics.DrawRectangle(&pen, rectF); ... GDI+ is supported by .NET by default. Normski. - Professional Windows Programmer
Thank you verymuch for your detailed response.
-
GDI is the base graphical system that comes with Windows XP/2K/NT/ME etc. If supports base drawing primatives and has limited image support. GDI+ is shipped as a DLL which you can use in your application for 2K/NT/ME this must be shipped with your app. (~1.6mb). What you give is rich support for images, gradient brushes, text etc. etc. The programming model also simplifies the use of GDI: EXAMPLE: WCHAR string[] = L"Draw text in a rectangle by passing a RectF to the DrawString method."; FontFamily fontFamily(L"Arial"); Font font(&fontFamily, 12, FontStyleBold, UnitPoint); RectF rectF(30.0f, 10.0f, 100.0f, 122.0f); SolidBrush solidBrush(Color(255, 0, 0, 255)); graphics.DrawString(string, -1, &font, rectF, NULL, &solidBrush); Pen pen(Color(255, 0, 0, 0)); graphics.DrawRectangle(&pen, rectF); ... GDI+ is supported by .NET by default. Normski. - Professional Windows Programmer
I like the GDI+ compared to GDI just for the image support alone. I still find it confusing since to me it seems you have to convert some things to GDI+. For example Rect to Crect when you use GetClientRect() or creating a bmp with CreateCompatibleBitmap() then using the HBITMAP handle for GDI+ Bitmap::FromHBITMAP(). Or am I missing something? Other than that I love the new bush and image classes.
-
GDI is the base graphical system that comes with Windows XP/2K/NT/ME etc. If supports base drawing primatives and has limited image support. GDI+ is shipped as a DLL which you can use in your application for 2K/NT/ME this must be shipped with your app. (~1.6mb). What you give is rich support for images, gradient brushes, text etc. etc. The programming model also simplifies the use of GDI: EXAMPLE: WCHAR string[] = L"Draw text in a rectangle by passing a RectF to the DrawString method."; FontFamily fontFamily(L"Arial"); Font font(&fontFamily, 12, FontStyleBold, UnitPoint); RectF rectF(30.0f, 10.0f, 100.0f, 122.0f); SolidBrush solidBrush(Color(255, 0, 0, 255)); graphics.DrawString(string, -1, &font, rectF, NULL, &solidBrush); Pen pen(Color(255, 0, 0, 0)); graphics.DrawRectangle(&pen, rectF); ... GDI+ is supported by .NET by default. Normski. - Professional Windows Programmer
It's actually making sense to me now. The graphics object is associated with a dc then you can use that graphics object to draw, paint or what ever you can dream of. You can even have multiple graphics objects associated with a dc and each one is independent which I think is pretty cool. I was trying to use multiple dc's associated with multiple graphics objects and wondering why each object I had was independent. LOL It's just one big wrapper for GDI. Looks like MS is trying to integrate GDI+ more closely to DirectX.
-
It's actually making sense to me now. The graphics object is associated with a dc then you can use that graphics object to draw, paint or what ever you can dream of. You can even have multiple graphics objects associated with a dc and each one is independent which I think is pretty cool. I was trying to use multiple dc's associated with multiple graphics objects and wondering why each object I had was independent. LOL It's just one big wrapper for GDI. Looks like MS is trying to integrate GDI+ more closely to DirectX.
Jay If this makes you feel any better, I wrote my 2nd windows app. a tile puzzle game similar to the apple one. I tried to use a DC for each tile... No No No. any way a good way of learning Win32/GDI I still have the source code 'circa 93 maybe a good time to revamp and submit as a codeproject app. :~ Normski. - Professional Windows Programmer
-
Jay If this makes you feel any better, I wrote my 2nd windows app. a tile puzzle game similar to the apple one. I tried to use a DC for each tile... No No No. any way a good way of learning Win32/GDI I still have the source code 'circa 93 maybe a good time to revamp and submit as a codeproject app. :~ Normski. - Professional Windows Programmer
I keep maintaining a 2D chat client/server app and every time I set out to learn something new or better I apply it to my app. It was my first windows app that I attempted. My wife likes these 2D chats and their kinda of fun. I told her I could program one better. ;) Three years later and I'm still making it better. :~ LOL I was a big windows hater in the beginning and was determined to stay Unix/Linux or Dos based - that quickly changed when I seen the bigger paycheck. So everything for a reason. Since going for the windows based work I'd have to say I'v learned more than ever from the experience. It would be cool to see how you did your game - That is if you really want to give it up. I might do another app for codeproject dealing with unlimited dynamic menu sub items for a bookmark idea I did. Sort of like IE explorer. I never seen decent examples of that. Anyways I'm rambling on. :zzz: Cheers Norm