Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-26-2010, 12:44 AM   #1
puneeth bhat
Registered: Jan 2010
Posts: 30

Rep: Reputation: 15
Cool image rescaling using sdl

how can i do image rescaling in sdl.....i m receiving the RGB image of 640*480,i have to change it to 352*288 while displaying in there any direct api to change it.
Old 03-26-2010, 05:56 PM   #2
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Try to implement something like: (Where picture is a linear array of pixels, and putpixel plots pixels).
int x,y;
for(x=0;x < 640;x++){
      for(y=0;y < 480;y++){
            putpixel(x * 1.82, y * 1.666, picture[(y * 640) + x]);

Last edited by smeezekitty; 03-26-2010 at 05:57 PM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
program usring SDL lib run at ARM board, show image speed is very slow. yuechun Linux - Software 0 12-22-2009 07:55 AM
SDL segmentation fault and image corruptions sparker Programming 3 04-01-2008 05:52 PM
Radeon 9250 no rescaling bluesmanu Linux - Hardware 1 03-01-2006 10:48 AM
SDL Image problem.. where do I put... RHLinuxGUY Programming 3 07-23-2005 04:36 AM
sdl .raw image-based map loading elvee Programming 2 10-09-2004 03:03 AM

All times are GMT -5. The time now is 05:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration