C++ Win32 GDI+ draw lines, rectangles, ellipses, images

preview_player
Показать описание
How to draw draw lines, rectangles, ellipses, images with GDI+ on a Windows native window (Win32 API)

Source code for this video:

Link for my previous video about creating a Win32 window:

Links for the Visual Studio 2017 and vcpkg installation tutorials (if necessary):
Рекомендации по теме
Комментарии
Автор

As with some of the other commenters, I too have wasted so much time trying to figure out how to draw things on the new screen I wasted weeks trying to figure out how to create. And your video solved most of my problems. THANKYOU! Now I need to figure out how to draw text, because std::cout does not work with "hwnd" windows. I wasn't even using Visual Studios, just Mingw64 with Notepad++ :)

haroldmcbroom
Автор

Thank you also so much.... I wasted so much time reading the documentation and still couldn't get gdiplus to operate. Now I know, I hadn't set my linker to find the gdiplus lib. Thank you, a new subscriber and keep them coming.

henrythompson
Автор

Thanks, this really helped with my understanding of gdi+!

TheLostBytes
Автор

Thank you so much! I was struggling with making a display for my C++ code and you helped me out a lot.

danielcreatd
Автор

Your Latin English pronunciation is SO CUTE. I’ d love it. Please teach me about the usage in the Linux platform. I mean the usage of the MathGL. I can’t even draw a picture by this. I said, I could even not find out a software to run these cpp libraries. Help me.

hwilee
Автор

Can you use this for making custom title bars?

devisals
Автор

Thanks! I have one question though, how do I change the pen's thickness?

coulomb
Автор

Proble solved. To fix the problem is necesary:
- Compile at 64 bits.
- Add a command to the linker: -lgdiplus

MasterMindmars
Автор

Can you show how to set the scaling ratio for DrawImage?

pewterhacker
Автор

Dev C++ generates several error messages when I complile all: unidentified command. ..
In Dev there is another library: libgdiplus.a This is at lib folder. Dev recognizes gdiplus.h in the source code, but the compiler g++ don't find the library even If it its at the parameters linier. Where is the problem ?

MasterMindmars
Автор

DOES ANYONE KNOW IF YOU CAN ADD CODE INSIDE THE WINMAIN() FUNCTION TO DRAW LINES, CIRCLES, AND OTHER GRAPHIC OBJECTS TO AVOID DOING IT IN THE WINPROC() FUNCTION.

mariostelzner