Odd artifact when drawing rounded corners in canvas

Just a hunch, are you drawing on a HiDPI scaled screen for that screenshot?

If so, what scaling factor are you using ? 125%?

Oh its GDI+, let me check something.

No, it’s just standard resolution.

I haven’t worried about HiDPI because the software will likely be run on older devices, ie. an old cheap laptop. The software will be mainly used outside and there is a possibility the laptop could be destroyed during testing.

Yeah, that blur is a bug too, the maths is wrong inside the routine and its landing in between a pixel to its dithering the line.

Let me see if I can find a way around it.

Hi Steve

Did you try the sample code I posted earlier?

I appreciate it Julian, but you don’t have to - unless of course you enjoy those sorts of challenges. I’ve ended up creating the image in Illustrator and exporting as a transparent png - it looks fine. At some point I will be upgrading so hopefully that issue will be gone

I have to say, I hope where you work appreciates your taking things to the nth degree just to get it right. :slight_smile:

[quote=360712:@Kevin Gale]Hi Steve
Did you try the sample code I posted earlier?[/quote]

Whoops, no I didn’t Kevin. No offense and I don’t mean to sound rude, but the code looked too complicated for me to implement easily. That’s why I didn’t try.

You just need to paste the code into a module and you can then do something like:

MyPicture.RoundRect(…

The style parameters are hardcoded but it would be easy to make them parameters or use the graphics object.

Sorry Kev, at this point in the evening, even that sounds too hard :slight_smile:

I tried it Kevin, but it came out with similar blur. The problem lies in the DrawObject call, it can only accept integers but it needs to be shifted by 0.5 in the vertical to stop the anti-aliasing on the horizontal lines.

Hehe, no problem, using a static image is a good solution until you come over to the dark side (D2D ;)). I was going to try RoundRectShape but that has the same problem with the call to DrawObject.

I’m a landlord now, my days working the 9-5 are long gone. Some people do crosswords, I help (or hinder) here :wink:

Thanks Julian, a bit off-topic but still relevant:

So when I do upgrade where D2D is used, does that mean I have to refactor my code, or I can I still use the code I have without making any alterations?

The original code you posted should just work and you wont need the DrawRoundRect, here’s what it’ll look like:

Nice and crisp.

As for your other code, it should just work unless you have put in hacks to get around bugs that are now fixed :slight_smile:

Ooooooohhhh, Shiny! . . . that is so beautiful . . . sorry, I couldn’t help it :slight_smile:

I’ve only done some small hacks but nothing that involves complicated code (I’m not that smart). My last upgrade was 2016R4 which had some issues displaying text and labels. I’ve since just stayed with 2016R3.

At the moment I still have a valid license, so I should just upgrade to the latest version.

My main concern (and likely unfounded) is that upgrading could introduce another issues that I won’t be aware of until months down the track and would somehow have to backtrack.

As I said before, I’m not that smart to know these things :slight_smile:

[EDIT]
I’ve been working part-time on this software for 18 months+ and I don’t want to break it.

As long as you’re not doing crazy UI things like embedding a canvas inside six other container controls then scrolling it all four different directions you should be ok :wink:

Your best bet would be to fire up the newest version and test it, oh and backup first, then backup the backup :wink:

If things go south, I hear there’s some peeps around that can fix bug you find :smiley:

You cant make an omelette without breaking some chickens… or was it eggs :wink:

mmm… Drawing in Xojo does appear to be messed up. The adding of 0.5 should be handled for us to prevent the anti-alias issue. I tried adding 0.5 to the object co-ordinates as these are floating point but it didn’t make a difference.

You are right Julian. At this moment I’m downloading the latest version 2017R21 - 2.1?

I guess I’ve been reticent about changing anything. Now as I get to the “clean-up” stage of my software, ie. changing some basic text to graphic elements, these issues become more noticeable.

I don’t have “things like embedding a canvas inside six other container controls then scrolling it all four different directions” that I’m aware of.

Yep, I always do backups. My basic method is to increment using Numeric+Alphabet. At this point I’m at version: V10J, which means this is version number 244 since early 2016.

Cheers.

If its not broken, you’re not trying hard enough :wink:

Yeah I guess that’s ok especially for a hobbyist programmer like me. Normally (in my paid job), I don’t like to just upgrade software to the latest - I usually take the position to hang back until the bugs have been ironed out (12 months at the least).

So, Ive download 2017R2.1 and opened a copy of my software.

Firstly, I must say that the annoying artifact in question is no longer there :slight_smile: Yippeee!

A few things are immediate. with WIN7

  • The Font in the IDE is thin and pixellated. :frowning: (As per 2016R4)
  • My custom canvas buttons no longer display text :frowning: (StringShape has be depricated?)
  • Tabbing through fields causes much more flicker on label controls and looks sluggish :frowning:

When this sort of thing happens, then my initial fears seem vindicated.

It’s not a problem because I can easily go back to 2016R3.

This thread has run it’s course. I should start a new thread entitled: Steve Kelepouris and his exploits into the realm beyond 2016R3. That would be fine, and I’m sure I could work around some of these issues with the help of members of this forum, and be the better for it. But for now, to finish my project, the sensible and quickest way is to just stay with 2016R3.

I absolutely appreciate everyone’s input

Cheers.

Couple of recent threads on Windows flickering
https://forum.xojo.com/37786-controls-flickering-on-scroll
https://forum.xojo.com/40858-flicker-reduction-attempts