Does anyone know any good resources where one could learn GDI+ (Gdi plus) with the Win32 api? There are many resources for learning Gdi+ with MFC, but not with win32.

I tried learning gdi plus with win32 on my own, but ran into the following problem:

Graphics graphics(hdc);
Pen blackPen(Color(255,0,0,0), 3);
graphics.DrawLine(&blackPen, 0, 0, 100, 100);

The error I recieved from the above code was: initialization of 'blackPen' is skipped by 'case' label.

Does anyone know how to create a Pen object in GDI+/win32 without actually initializing it as was done in the example above?

I already tried writing something like:

Pen blackpen;

but I still got an error message ("no default constructor exists for class "Gdiplus::pen""). Any help on how to write gdi+ code for win32 would be greatly appreciated. Thanks in advanced.

Can GDI+ be used with Win32, or is it exclusively for MFC? I know how to use GDI with win32, but not GDI+, thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.