Solved

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

Posted on 2004-04-08
7
575 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

740 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