I need to:

1. Load a bitmap from a resource,
2. Scale it to a given x,y size,
3. Convert it to PNG and,
4. Dump the bits into a memory buffer (in PNG format).

Please suggest the best way to do that.
Preferably, no intermediate file I/O.

Language: C++
I can use: Raw GDI, ATL/WTL, GDI+

Point amount reflects urgency.

Thank you!
LVL 11
Who is Participating?
chensuConnect With a Mentor Commented:
1. Use the LoadImage() API function.
2. Use the CopyImage() API function.
3. ?
4. ?
Using the

Status Image::Save(IStream *stream,
    const CLSID *clsidEncoder,
    const EncoderParameters *encoderParams

method and IStream (creating a memory stream), you can do #4.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

alexoAuthor Commented:
Sorry, forgot to mention something:
The desired size is in inches, not in pixels.

alexoAuthor Commented:
Hmmm, nevermind...
alexoAuthor Commented:
Sorry, I was on vacation...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.