Scaling/resize a GDI+ CImage

Discussion in 'Microsoft VC .NET' started by Howie (remove _), Feb 27, 2004.

  1. 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
     
    Howie (remove _), Feb 27, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. obj

    GDI+ Resize Bitmap time ???

    obj, Sep 30, 2003, in forum: Microsoft VC .NET
    Replies:
    0
    Views:
    507
  2. Lloyd Dupont

    (plain) GDI (not GDI+) scaling question

    Lloyd Dupont, Aug 11, 2005, in forum: Microsoft VC .NET
    Replies:
    1
    Views:
    234
    Lloyd Dupont
    Aug 14, 2005
  3. John Swan

    Image resize using GDI+?

    John Swan, Dec 12, 2005, in forum: Microsoft VC .NET
    Replies:
    4
    Views:
    345
    John Swan
    Dec 12, 2005
  4. Lloyd Dupont

    Mixing GDI+ & GDI drawing

    Lloyd Dupont, Feb 16, 2006, in forum: Microsoft VC .NET
    Replies:
    0
    Views:
    338
    Lloyd Dupont
    Feb 16, 2006
  5. rejidasan

    Loading PNG\JPG Images in MFC without using GDI\GDI+

    rejidasan, Apr 3, 2007, in forum: Microsoft VC .NET
    Replies:
    2
    Views:
    1,126
    Michael Phillips, Jr.
    Apr 3, 2007
Loading...

Share This Page