Is there any way to convert a sprite to an image?
Trying to create an AVI on the fly with AVIServ, but when not using SaveSprite & LoadImage (slow) it wont work...
Tried ImageOutput() and some other things, but nothing works!
[EDIT]
I am trying to save what is seen onscreen and i use GrabSprite to get it, is there some other way thats better and allows me to get it as an image.
Sprite To Image
-
- User
- Posts: 60
- Joined: Wed Apr 30, 2003 2:25 pm
- Location: Västerås
- Contact:
I took this out of the forums recently... can't remember who's code it was but I have modified it slightly.... apologies to the original author.
;capture a piece of screen
Procedure.l CaptureScreenToImage(ImageNumber.l, Left.l, Top.l, Width.l, Height.l)
Protected BMPHandle.l
srcDC = CreateDC_("DISPLAY", "", "", 0)
trgDC = CreateCompatibleDC_(srcDC)
BMPHandle = CreateCompatibleBitmap_(srcDC, Width, Height)
SelectObject_( trgDC, BMPHandle)
BitBlt_( trgDC, 0, 0, Width, Height, srcDC, Left, Top, #SRCCOPY)
DeleteDC_( trgDC)
ReleaseDC_( BMPHandle, srcDC)
CreateImage(ImageNumber, Width, Height)
StartDrawing(ImageOutput())
DrawImage(BMPHandle, 0, 0)
StopDrawing()
DeleteObject_(BMPHandle)
EndProcedure
;capture a piece of screen
Procedure.l CaptureScreenToImage(ImageNumber.l, Left.l, Top.l, Width.l, Height.l)
Protected BMPHandle.l
srcDC = CreateDC_("DISPLAY", "", "", 0)
trgDC = CreateCompatibleDC_(srcDC)
BMPHandle = CreateCompatibleBitmap_(srcDC, Width, Height)
SelectObject_( trgDC, BMPHandle)
BitBlt_( trgDC, 0, 0, Width, Height, srcDC, Left, Top, #SRCCOPY)
DeleteDC_( trgDC)
ReleaseDC_( BMPHandle, srcDC)
CreateImage(ImageNumber, Width, Height)
StartDrawing(ImageOutput())
DrawImage(BMPHandle, 0, 0)
StopDrawing()
DeleteObject_(BMPHandle)
EndProcedure
-
- User
- Posts: 60
- Joined: Wed Apr 30, 2003 2:25 pm
- Location: Västerås
- Contact: