Mirror Image ?

BlitzMax Forums/BlitzMax Programming/Mirror Image ?

Filax(Posted 2008) [#1]
hi :)

This program seem don't work with the last blitmax version ?
or i'm wrong ?

http://www.blitzbasic.com/codearcs/codearcs.php?code=19





Dreamora(Posted 2008) [#2]
Correct declaration of the images would make a serious performance difference
(ie use :TImage etc, otherwise its slow as it is converted to int and back)

And if you set the blendmode to alpha it would potentially not ignore the alpha channel as well :)


Filax(Posted 2008) [#3]
Ok !! Many thanks dreamora :)

Edit : New code




Grey Alien(Posted 2008) [#4]
Don't forget you can mirror when drawing simply by setting SetScale -1,1. You probably knew that but maybe others didn't...


tonyg(Posted 2008) [#5]
Ooops. Sorry misread


xlsior(Posted 2008) [#6]
Don't forget you can mirror when drawing simply by setting SetScale -1,1. You probably knew that but maybe others didn't...


also -- if you *need* an image to be stored in flipped format, I wonder if it wouldn't be faster to to a setscale -1,1, draw it, and just use a grabimage on it (instead of re-drawing it a pixel a time)

Unless you have some alpha blending going on as well, it might be faster to do it that way?


Dreamora(Posted 2008) [#7]
his redraw per pixel is only needed due to the alpha information. The Pixmap has a straight X Y flip command that he used ;-)

and grab image isn't the fastest way as it does a grabpixmap -> loadimage from that ... so lockimage yflip(pixmap) unlock might be faster, no grabbing involved.