Scaling/resize a GDI+ CImage

H

Howie (remove _)

Hi,

i want to resize a image to create a texture to use with OpenGL.
OpenGL needs a size of pover^2.

This is my first try:

CImage texture1;
HRESULT hResult = texture1.Load(texturefilename);
long SizeX = SafeSize(texture_.GetWidth()); //Calculate Power^2
long SizeY = SafeSize(texture_.GetHeight());
CImage texture;
HDC hDC = texture.GetDC();

texture1.StretchBlt(hdc,0,0,SizeX,SizeY,0,0,texture1.GetWidth(),texture1.GetHeight());

But texture.GetWidth() ist alway 0;

Where is my fault ?


Thanks,

Howie
 
Top