Using GDI + Bitmap

I use the GDI + Bitmap class to convert IStream to HBITMAP. I included the gliplus lib file in the Linker inputs, as well as the DLL in the build path. But using the statement

Bitmap bm(lpStream,FALSE);

gives me error C2065: "Bitmap": undeclared identifier

Can someone please tell me what I'm doing wrong here.

Thanks.

<i> Change>
I have already included the appropriate headers in my implementation (gdiplus.h). And I can view the definition of Bitmap by selecting the "Go to definition" option in the context menu.

+3
source share
2 answers

. , , , , "Bitmap.h" "gdi +.h".

​​ . - "gdiplus.h". :

#include "gdiplus.h"

Constructor Information
Stock Implementation  gdiplus.dll
Header    Declared in Gdiplusheaders.h, include gdiplus.h
Import library    gdiplus.lib
Minimum availability  GDI+ 1.0
Minimum operating systems  Windows 98/Me, Windows XP, Windows 2000,

Windows NT 4.0 SP6

MSDN, "", , . " ", . , .

EDIT: , GDI +, , Gdiplus, . "using namespace Gdiplus", .

#include <windows.h>
#include <gdiplus.h>
using namespace Gdiplus;

VOID OnPaint(HDC hdc)
{
   Graphics graphics(hdc);
   Pen      pen(Color(255, 0, 0, 255));
   graphics.DrawLine(&pen, 0, 0, 200, 100);
}
+2

Gdiplus , :

ULONG_PTR gdiplusToken;
GdiplusStartupInput startupInput;
GdiplusStartup(&gdiplusToken, &startupInput, 0);

, Gdiplus, :

GdiplusShutdown(gdiplusToken);

, Gdiplus GdiplusNotInitialized.

+3

Source: https://habr.com/ru/post/1702803/


All Articles