nanogui: Thread: Newbie ---- Regarding moving picture in window ( As like Scrolling banner on screen)


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Newbie ---- Regarding moving picture in window ( As like Scrolling banner on screen)
From: nimesh kanoth ####@####.####
Date: 2 Dec 2005 12:03:27 +0000
Message-Id: <20051202120308.48357.qmail@web32011.mail.mud.yahoo.com>

 
 
 Hi  all,
 
 I need to  scroll a picture inside a window. 
 I am using GrDrawToFit() fuction to draw picture on screen. then I am looping the Y-coordinate to move from one side to other side. But It very slow..  . Is there any other way to move picture .
 
 I atttach my code with this.............. Please help me ....
 filename = "/mnt/big.bmp";
 image_id = GrLoadImageFromFile(filename,0);
 
 while( 1 ) 
      50         GrDrawImageToFit(w1, gc,i,10,w,h, image_id);
      51         i-= speed ;
      52         if ( i % width == 0)
      53             GrClearWindow(w1,0);
      54         if ( i < -w ){
      55             GrClearWindow(w1,0);
      56             i = 640;
      57         }
      58         for(q=0;q<9999;q++);
      59     }
 
 Here Image is scale and fit to screen. Instead I want to move Image through the window.
 And Image width is more than window size.
 
 Please reply me Immediately.
 Nimesh
 
 
 
 
 

			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Gifts at Yahoo! Shopping 
Subject: Re: Newbie ---- Regarding moving picture in window ( As like Scrolling banner on screen)
From: "Jordan Crouse" ####@####.####
Date: 2 Dec 2005 14:59:57 +0000
Message-Id: <20051202150637.GH15827@cosmic.amd.com>

>  I am using GrDrawToFit() fuction to draw picture on screen. then I am looping the Y-coordinate to move from one side to other side. But It very slow..  . Is there any other way to move picture .
  
GdDrawImage is slow because it has to draw the whole thing pixel by pixel,
translating colors and then drawing them to the screen (see GdDrawImage in 
engine/devdraw.c to see what I'm talking about). Any time you jump into a 
for(y)/for(x) loop, things are going to be slow.

What you want to do is draw the image offscreen, and then use GrCopyArea
to to copy the parts of the image you need on screen.

Good Luck,
Jordan

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.