LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-25-2010, 11:44 PM   #1
puneeth bhat
Member
 
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 sdl...is there any direct api to change it.
 
Old 03-26-2010, 04:56 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,227

Rep: Reputation: 170Reputation: 170
Try to implement something like: (Where picture is a linear array of pixels, and putpixel plots pixels).
Code:
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 04:57 PM.
 
  


Reply

Tags
sdl


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 06:55 AM
SDL segmentation fault and image corruptions sparker Programming 3 04-01-2008 04:52 PM
Radeon 9250 no rescaling bluesmanu Linux - Hardware 1 03-01-2006 09:48 AM
SDL Image problem.. where do I put... RHLinuxGUY Programming 3 07-23-2005 03:36 AM
sdl .raw image-based map loading elvee Programming 2 10-09-2004 02:03 AM


All times are GMT -5. The time now is 04:21 PM.

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