Solved

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

Posted on 2004-04-08
7
569 Views
Last Modified: 2013-12-03
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!
0
Comment
Question by:alexo
  • 3
  • 3
7 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 500 total points
ID: 10785927
1. Use the LoadImage() API function.
2. Use the CopyImage() API function.
3. ?
4. ?
0
 
LVL 23

Expert Comment

by:chensu
ID: 10786009
0
 
LVL 23

Expert Comment

by:chensu
ID: 10786044
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Author Comment

by:alexo
ID: 10786368
Sorry, forgot to mention something:
The desired size is in inches, not in pixels.

Thanks.
0
 
LVL 11

Author Comment

by:alexo
ID: 10786376
Hmmm, nevermind...
GetDeviceCaps(LOGPIXELSX)
0
 
LVL 11

Author Comment

by:alexo
ID: 11084230
Sorry, I was on vacation...
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now