WM_PAINT

BlitzPlus Forums/BlitzPlus Programming/WM_PAINT

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

OK, it is good and fast but ... I was already using a fast routine that I found on blitzcoders (I think). I am using it to scale up some text smoothly (1 iteration per frame) and it is ever so slightly faster that your code when the text gets bigger. Don't know why. I am talking your code takes max 14-15ms to do my scaling and the other code takes max 10-11ms to do the same scaling. But thanx anyway. Oh yeah your function is easier to use too.

the other code is this:

Global scratch%=CreateImage(640,480) ;this should be freed later
Function DrawSizeImage(image,x%,y%,w%,h%)
     Local ih%=ImageHeight(image)
     Local iw%=ImageWidth(image)

     Local sw%=Abs(w)
     Local sh%=Abs(h)
     
     Local xr#=(Float(iw)/Float(sw))
     Local yr#=(Float(ih)/Float(sh))
     
     fromimg=ImageBuffer(image)
     toimg=ImageBuffer(scratch)
     
     Local vf=-1+((h>0)*2)
     
     Local fw=(w<0)*w
     Local fh=(h<0)*h
     
     If w>=0
          For ix=0 To sw
               CopyRect ix*xr,0,1,ih,ix,0,fromimg,toimg
          Next
     Else
          For ix=0 To sw
               CopyRect ix*xr,0,1,ih,sw-ix,0,fromimg,toimg
          Next
     EndIf
     

     For iy=0 To sh
          CopyRect 0,iy*yr,sw,1,x+fw,y+(iy*vf),toimg
     Next

End Function