Click here to Skip to main content
13,141,637 members (56,524 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Who can send me an efficient algorithm of image scaling for C / C + + source code?
By the way, CXImage is achieved in the image scaling? How to call?
Posted 17-Feb-11 21:28pm
Amit Kumar Tiwari 18-Feb-11 3:34am
I can send you that, but what will I get :P
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

markliu-codeproject 18-Feb-11 22:37pm
Amit Kumar Tiwari,thanks very much.
Your answer is very useful!
Amit Kumar Tiwari 19-Feb-11 11:38am
Welcome buddy
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The GDI resize API is called StretchBlt().
Andrew Brock 18-Feb-11 6:34am
GDI is simple to use, but somewhat lacking in performance, which was a requirement of the OP. 4.
Hans Dietrich 18-Feb-11 13:40pm
I considered GDI's performance for .5 seconds before answering, then I figured the OP would like to have something that actually works in the general case. :)
If you're really keen on this, why not dash off an article comparing relative performance (GDI vs. ?) for image resize? I would love to read that. There are many algos floating around for doing this, but most simply don't work (at least on the images I've tried). StretchBlt() always works. Seriously, if you know this stuff, please write an article.
Andrew Brock 19-Feb-11 3:42am
If I had the time I would have written lots of articles. But I'm currently working on a thesis.
I only help out in here because it doesn't take much time.
Rais Shaikh 11-Jul-16 6:01am
I tried using StretchBlt but image quality is changing as well as some pixels are giving different values using Getpixel function..
markliu-codeproject 18-Feb-11 22:40pm
Sorry,I can not use StretchBlt.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You might try my DLL (see the article: "Plain C Resampling DLL"[^]), however, I don't know if its performance would fit your needs.
markliu-codeproject 18-Feb-11 22:39pm
CPallini,Thanks very much.
I will try your dll later.
CPallini 19-Feb-11 3:37am
You're welcome. :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 18 Feb 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100