Mojo 2 : only scale an image.

Monkey Forums/Monkey Beginners/Mojo 2 : only scale an image.

hub(Posted 2015) [#1]
Hi !
1) How to only scale an image with modo2 ? not all the device screen or others images.
2) Is it possible to 'zoom' on it with the mouse as 'Lightroom' magnifying glass tool ?

ImmutableOctet(SKNG)(Posted 2015) [#2]
You mean like zooming from the center/handle? Because, though there's plenty of ways to handle this yourself, Mojo and Mojo 2 both have overloads that can do this.

For Mojo, you have 'DrawImage' and 'DrawImageRect', which have useful overloads for this (As linked). If you want to do this manually, then you can do something similar to what those overloads do.

For Mojo 2, it's basically the same deal, it's just accessed through a 'DrawList' or 'Canvas' object. And, the 'DrawImageRect' command is just handled by 'DrawRect' overloads.

hub(Posted 2015) [#3]
Many thanks. I use mojo2. i'm searching the commands

1) i use PushMatrix - Scale or Rotate - DrawImage - PopMatrix
2) set the push 'operation origin x,y to the mouse position MouseX(), MouseY() ... so my other question :

How to set the matrix 'operation origin'.

Actually i've it at 0,0. Note that my image PosX = DeviceWidth()/2 and PosY = DeviceWidth() and by default 'MidHandled'

Thanks !

ImmutableOctet(SKNG)(Posted 2015) [#4]
Here, I'll just post an example:

hub(Posted 2015) [#5]
Many thanks SKNG.