Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bitmap object

Status
Not open for further replies.

szcygan

Programmer
Jul 18, 2001
19
0
0
PL
I have wrote this code below, it is supposed to create the bitmap object from the file. It's building ok, but when running the object has no data about the picture. Even worse - the pixel color pixelKolor doesn't change after GetPixel method... why??

#include <GdiPlus.h>
using namespace Gdiplus;

wfile = L&quot;D:\\are0.bmp&quot;;
Bitmap bitmapa(wfile, useIcm);
Color pixelKolor(100,100,100,100);
int h = bitmapa.GetHeight();
int w = bitmapa.GetWidth();
bitmapa.GetPixel(100,120,&pixelKolor);
alfa = pixelKolor.GetAlpha();

thnx
 
Ok... I've got it. The following was missing... whatever that is:

GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top