GDI+ image*

This is a discussion on GDI+ image* within the Windows Programming forums, part of the Platform Specific Boards category; hi all; im creating a small program to scan the contents of a dir and resize all images in there ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    5

    GDI+ image*

    hi all;

    im creating a small program to scan the contents of a dir and resize all images in there to a specified width/height. anyway the problem is i cant change the width / height properties of the image.

    i am using the gdi+ Image* image = new Image(wFile); to open my image, then i am getting its width and height

    UINT imageHeight = image->GetHeight();
    UINT imageWidth = image->GetWidth();


    then i go on to get the jpeg encoder and save the image, which makes a exact copy of the image i have opened.


    image->Save(oFile, &encoderClsid, &encoderParameters);


    i have searched everywhere in the msdn on a way to change the width and height properties of Image, but there doesnt seem to be a method to support that.

    So to finally ask my question, is there a way to change the width and height properties of the image class or is there another class that will take have a method to manipulate an image object?


    thanks for your help.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Welcome to the forums!

    Down the bottom of the documentation for Image::GetHeight(), there is a couple of links under the "See also" section. Have a look and see how far you get. If you need further help, please post back.

    If you need small images, you can also have a look at Image::GetThumbnailImage().

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    5
    hey thanks for the welcome and quick reply.

    I have been searching through the msdn for over a week now, its probably my bad searching methods but i've yet to find anything useful in saving a image with different width and height properties.

    What i have come up with is passing the image class to the graphics class, and then changing the width and height in the graphics class, and then passing it to the bitmap class to save the new width and height.

    i dont know if this is a stupid thing to do or not, but in theory this should work. Please teach me a better way if there is one. I love software development and am willing to learn anything.

    Thanks again

    danno.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows GDI vs. Java Graphics
    By Perspective in forum Windows Programming
    Replies: 7
    Last Post: 05-07-2007, 11:05 AM
  2. GDI object lifetime and C++ object lifetime
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 06-16-2006, 06:26 AM
  3. opengl, or gdi?
    By n3v in forum Game Programming
    Replies: 25
    Last Post: 05-21-2006, 06:02 PM
  4. Whats Peoples Problem With the GDI?
    By MicroFiend in forum Game Programming
    Replies: 6
    Last Post: 07-28-2003, 08:52 PM
  5. Double buffering in GDI -- easy?
    By fusikon in forum Game Programming
    Replies: 17
    Last Post: 02-15-2003, 10:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21