Anyone got a nice little CopyRect type of function

BlitzMax Forums/BlitzMax Programming/Anyone got a nice little CopyRect type of function

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Blimey lots of responses, thanks a lot! In the end I did this, which works fine:

' -----------------------------------------------------------------------------
' ccCopyRect
' -----------------------------------------------------------------------------
Function ccCopyRect(image:TImage,x,y,w,h,frame=0)
	'Draws a part of an image by using a viewport.
	SetViewport x,y,w,h
	DrawImage(image,x,y,frame)
	SetViewport 0,0,screenwidth, screenheight
End Function


Anyway see anything wrong with this? It should be cross platform too right?