Code archives/Graphics/Another drawimagerect
This code has been declared by its author to be Public Domain code.
Download source code
| |||||
Very simple drawimagerect function using standard Bmax commands so OK with GL/DX and takes rotates, blends etc. Seems fast enough to use in non-debug mode unless you're planning on hundreds per cycle. | |||||
Graphics 640,480 SeedRnd MilliSecs() image:TImage=LoadImage("max.png") While Not KeyHit(key_escape) Cls tg_drawimagerect(image,Rand(0,640),Rand(0,480),0,0,200,100) Flip Wend Function tg_drawimagerect(image:TImage,x:Int,y:Int,xs:Int,ys:Int,width:Int,height:Int) DrawImage LoadImage(PixmapWindow(LockImage(image),xs,ys,width,height)),x,y End Function |
Comments
| ||
bug: xy doesn't exist. Should be ys. |
| ||
...changed. At least somebody tried it. |
| ||
lol, yep. I was worried about my viewport version not being compatible with all PCs. |
Code Archives Forum