Hello, on 2016r2 w/ HiDPI/Retina mode enabled, is anyone seeing graphical tearing/distortion/artifacts on their canvas images? Especially when resizing the window in OS X… Whenever it redraws I get glitches. Double buffering does not affect the issue. This is on a 2014 Retina MBP. I did not try on a low resolution MBP yet.
What it’s supposed to look like:
Some of the glitches I see when resizing the window:
Windows low DPI and HiDPI are ok . . . just Retina OS X is where I see this issue.
Images are PNG files. Since I was working with limited resources I believe I used MSPaint to save the PNG. It may have been a freeware editor like Paint.NET though.
The canvas objects are only locked on two sides. One of them is locked Top-Left, and one is Top-Right. They don’t resize, they only move around when the window form size is manipulated by the user.
I recently switches to Canvases from ImageWells and BevelButtons when updating the project to work with Retina/HiDPI mode
Maybe my code I posted above is incorrect and that is causing the issues? The code there is how I keep the image aligned correctly. Seems to work great on Windows. OS X Retina just giving me headaches.
I expect what you’re seeing is that
g.drawpicture is specified using
x in points but the icon width is probably pixels so you have a mismatch here (ie/ me.width is in POINTS but imgRefreshIcon.Width is pixels)
y in points but the icon width is probably pixels so you have a mismatch here
width in points but you’re using the icon width which is pixels
height in points but you’re using the icon width which is pixels
and the rest of your args are more than likely in pixels (which on a hi dpi screen will be wrong)
[quote=278175:@Mike Cotrone]i can’t download that… Can you link it through tinypic.com or something?
Thanks[/quote]
Are you able to right click and save it?
I expect what you’re seeing is that
g.drawpicture is specified using
x in points but the icon width is probably pixels so you have a mismatch here (ie/ me.width is in POINTS but imgRefreshIcon.Width is pixels)
y in points but the icon width is probably pixels so you have a mismatch here
width in points but you’re using the icon width which is pixels
height in points but you’re using the icon width which is pixels
and the rest of your args are more than likely in pixels (which on a hi dpi screen will be wrong)
and also the HiDPI pdf next to the ide in its documentation folder
You’re drawing the whole thing anyways
So try altering that to[/quote]
OK I will try to look at it tomorrow when I have access to a Mac. Do you know why it would work on HiDPI Windows (3K screen) and not Retina with that code? Theoretically shouldn’t it fail on both platforms equally?
I have to be honest here, I am really bad with graphics and still a novice Xojo programmer. I will try to fumble my way through this
Mac users of my project are in the minority, so right now I am just making them deal with using the Retina version of my project with glitchy graphics
Yikes… Been working with Retina since 2012 and I don’t recall ever coming across an issue like this with a Xojo made application. Do you get the same issue in other applications?
As far as I can see, I agree with what Normal already pointed out. The OP should read
the blogs regarding Retina/HiDPI which are fundamental to understand how HiDPI works, especially when upgrading older project or using the new Xojo framework version.
#edit:
Do you have any other code that modifies the “g” before painting your image ?
Not sure if this was already mentioned but OS x you should use
Transparent = true
EraseBackground = false
DoubleBuff = false
An example project or even the full app would be useful. It’s hard to say for certain what’s going on without being able to take a look at the image files and what the program is trying to do.