Solved

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

Posted on 2004-04-08
7
572 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Search and Edit Form 6 71
Messagebox for a Web Site Application 4 63
Where to obtain Oracle Data Provider for .NET 3.5 7 47
Question to Pivot table 1 33
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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

14 Experts available now in Live!

Get 1:1 Help Now