Hi-Res Images at Natural Size?

Mark Waddingham mark at livecode.com
Thu Feb 25 07:04:25 EST 2016

On 2016-02-25 11:58, Scott Rossi wrote:
> Thanks for the explanation Mark.  The discrepancy in resolution is
> intensified in the simulator when a bitmap is displayed near text
> content, which remains sharp at any size.  So when one sets the
> simulator to 100% scale and sees perfectly rendered 2cm text
> characters drawn alongside a fuzzy mess of a bitmap, I think many
> would be of the opinion (flawed as it is) that something is amiss. :-)

I do think this is just a 'visual artifact' - remember that when you 
scale down an image it will be filtered (if the resizeQuality is at 
least good) - so in the iPhone simulator you will more clearly see the 
slight blurring that occurs as a result of this as you are seeing it at 
twice the size.

I've just confirmed the engine is doing things correctly:

on mouseUp
    local tImageData
    repeat with i = 1 to 64
       put numToByte(0) after tImageData
       put numToByte(0) after tImageData
       put numToByte(0) after tImageData
       if (i mod 2) is 0 then
          put numToByte(0) after tImageData
          put numToByte(255) after tImageData
       end if
    end repeat
    set the width of image 1 to 8
    set the height of image 1 to 8
    set the imageData of image 1 to tImageData

    set the width of image 1 to 4
    set the height of image 1 to 4
end mouseUp

Creates a small image on a stack whose image data is 8x8 but which is 
rendered at 4x4. The image is 8 vertical lines, each 1 pixel wide which 
alternates between black and blue.

On my non-Retina iMac, zooming the desktop in, the image is 4x4 solid 
dark blue - because it is downscaling by a factor of two, each pixel 
will be an average of 4 pixels - 50% black, 50% blue which is 50% blue 
(0,0,127 or thereabouts).

When I run the stack on a Retina iPhone simulator, I see all 64 pixels 
faithfully represented as I would expect since the simulated Retina 
screen uses two screen pixels for every logical pixel.

i.e. In other words, the engine will use as many device pixels as it has 
to render things (images are scaled from the original source size direct 
to the screen - and not via the number of logical pixels).

Warmest Regards,


Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

More information about the Use-livecode mailing list