Solved

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

Posted on 2004-04-08
7
573 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 Scheduled Tasks 11 88
Clean Uninstall of VS Professional 2015 5 52
Problem to file 3 74
Is IHttpActionResult a promise pattern? 2 67
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

772 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