Ooops
March 01, 2021, 11:12:23 PM

Author Topic: [bmx] Another drawimagerect by tonyg [ 1+ years ago ]  (Read 416 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bmx] Another drawimagerect by tonyg [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : Another drawimagerect
Author : tonyg
Posted : 1+ years ago

Description : 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.


Code :
Code: BlitzMax
  1. Graphics 640,480
  2. SeedRnd MilliSecs()
  3. image:TImage=LoadImage("max.png")
  4. While Not KeyHit(key_escape)
  5.   Cls
  6.   tg_drawimagerect(image,Rand(0,640),Rand(0,480),0,0,200,100)
  7.   Flip
  8. Wend
  9. Function tg_drawimagerect(image:TImage,x:Int,y:Int,xs:Int,ys:Int,width:Int,height:Int)
  10.     DrawImage LoadImage(PixmapWindow(LockImage(image),xs,ys,width,height)),x,y
  11. End Function


Comments :


Grey Alien(Posted 1+ years ago)

 bug: xy doesn't exist.  Should be ys.


tonyg(Posted 1+ years ago)

 ...changed. At least somebody tried it.


Grey Alien(Posted 1+ years ago)

 lol, yep.  I was worried about my viewport version not being compatible with all PCs.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal