Bitmap-->scaling-->PNG-->Buffer

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
alexoAsked:
Who is Participating?
 
chensuConnect With a Mentor Commented:
1. Use the LoadImage() API function.
2. Use the CopyImage() API function.
3. ?
4. ?
0
 
chensuCommented:
Using the

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

method and IStream (creating a memory stream), you can do #4.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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

Thanks.
0
 
alexoAuthor Commented:
Hmmm, nevermind...
GetDeviceCaps(LOGPIXELSX)
0
 
alexoAuthor Commented:
Sorry, I was on vacation...
0
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.