iOSGraphics.DrawImage Makes a Blurry Image

I have a crisp 32x32 line image (and its associated 64x64 an 96x96 counterparts). It’s a simple icon.

If I draw that into a canvas without any scaling, resizing, etc, using the Canvas graphics.DrawImage method, it looks a little blurry.

However if I use that same image as the Image for an ImageView, it looks crisp.

Is that right?

I think this is relying on the graphics context’s settings. Do you have any insight if there are already declares for it?

Also, the way the image is created might influence the quality. In this short video you see an OS X ImageWell with a Xojo Picture cast on it. When “High Quality” is clicked, the NSView’s image property is set to another copy of this picture, only this time via a NSImage created via initWithData coming from OriginalPicture.GetData (Picture.FormatPNG). This takes incredibly much longer but is a lot smoother.

NSImage conversion quality

EDIT: Probably easier to see: On the left a NSImage created from the Xojo image via copyOSHandle.CGImage, in the middle via PNG data and on the right just the Xojo image cast to the ImageWell directly. Times for setting the images in the textarea.

[quote=173865:@Jason Tait]I have a crisp 32x32 line image (and its associated 64x64 an 96x96 counterparts). It’s a simple icon.

If I draw that into a canvas without any scaling, resizing, etc, using the Canvas graphics.DrawImage method, it looks a little blurry.

However if I use that same image as the Image for an ImageView, it looks crisp.

Is that right?[/quote]

It doesn’t sound right. Are you sure the coordinates you’re drawing to are integral values?

No I’m not sure Joe. I don’t even know what that means. :slight_smile: I am drawing just to 0, 0 without any scaling factor.

Is the canvas you’re drawing into an even multiple of the size of the image ?
16 (scale .5)
32 (scale 1)
64
etc

That was the issue. Thank you Norman.