Scale(x,y) - Preserve hard edges?

Monkey Forums/Monkey Programming/Scale(x,y) - Preserve hard edges?

DPbrad(Posted 2012) [#1]
Hey guys,

Just a question regarding scaling images. I have a small icon which 16x16 pixels. I am trying to scale this up to 32x32 pixels by using

Scale(2.0,2.0)


Yet, although the scale works, it makes the icon look really blurry, almost to the point you cant see what it is supposed to be. Is there anyway of scaling up the image without trying to anti-alias or smooth the images.

Perhaps its easier to show with an image!

Left - Original icon (Not the actual icon, just an example)
Middle - What I want!
Right - What's happening...



Anybody know if this is possible to correct (Without resizing images, as this would break most of my interface system...)


therevills(Posted 2012) [#2]
I havent yet tried it, but try putting:
#MOJO_IMAGE_FILTERING_ENABLED=false

At the top of your project...


DPbrad(Posted 2012) [#3]
Works great, cheers.

#MOJO_IMAGE_FILTERING_ENABLED="False"



teremochek(Posted 2012) [#4]
#MOJO_IMAGE_FILTERING_ENABLED="false"
(With a small letter "f")


DPbrad(Posted 2012) [#5]
It worked fine with a capital "F" as well.


benmc(Posted 2012) [#6]
Which versions of Monkey is this available in?

Can you go back and forth between modes during run-time?


therevills(Posted 2012) [#7]
Can you go back and forth between modes during run-time?


Nope I don't think so. I did "hack" mojo to add this so you can go back and forth at run-time here:

http://www.monkeycoder.co.nz/Community/posts.php?topic=993#8568


benmc(Posted 2012) [#8]
I think'll have to hack it myself too. Agreed, this would be a slick feature in the next release.