Main Menu

getimage question

Started by micky4fun, January 16, 2009, 10:02:15 AM

Previous topic - Next topic

micky4fun

QuoteGetImage lets the user grab a region of pixels from the screen or image, and create a new image from it. This image can then be used just as other image
does the image that this command have to be drawn to the screen or can i use this or another command to grab a part of another image that is not drawn to the screen? , i.e image in memory .
i want to do what this program does but without displaying image 1 on the screen , is there another way to do it with getimage or another command

LoadFxImage CurrentDir$()+"gfx\numbers.bmp",1

do
for a=1 to 264 step 29
   cls 0
   drawimage 1,0,0,1
getimage 2,a,0,a+30,48
drawimage 2,100,500,1
sync
wait 200
next a
loop

thanks mick :)

kevin

#1
 No,  you can redirect Rendering to an Image.  Once you do this, you're drawing & grabbing from that surface.   You can only see the screen though. So be careful.  A common mistake is to change rendering to an image and then forget to redirect rendering back to the screen.    


Ie.

PlayBASIC Code: [Select]
  ThisIMage= LoadNewImage("mypicture")

RenderToIMage ThisImage

ThisFrame=GetFreeImage()
GetImage ThisFrame,x1,y1,x2,y2


RenderToScreen

DrawImage ThisFrame,x,y,true





  --> More Info: Check out PlayBASIC Images documentation Online



micky4fun

Hi Kevin

well 6 minutes for a reply , thats far to long , haha

works a treat , so easy when you know how

thanks
mick :)