I’m doing some drawing in Windows and I’ve run into a weird issue.
I draw a triangle, simple enough.
Drawing it with the point up, I get a nice clean, crisp triangle.
Drawing it point down, I get a weird anti-aliased effect on the flat side of the triangle.
I’m not quite sure why it would behave that way, maybe there’s a better way to draw it?
Does anybody have any suggestions / ideas?
Screenshots:
Code:
dim ariPoints(6) as Integer
if iDirection = 0 then // point up
ariPoints(1) = 5
ariPoints(2) = 0 // Top point
ariPoints(3) = 9
ariPoints(4) = 5 // Btm right
ariPoints(5) = 0
ariPoints(6) = 5 // Btm left
elseif iDirection = 1 then // point down
ariPoints(1) = 5
ariPoints(2) = 4 // Btm point
ariPoints(3) = 9
ariPoints(4) = 0 // Top right
ariPoints(5) = 0
ariPoints(6) = 0 // Top left
end
g.FillPolygon(ariPoints)
Oh I hadn’t thought of that, quite clever!
What font/character should I use? I don’t see any arrow directions on asciitable.com but I’m pretty sure they exist.
I’ve solved it, but not the way I’d hoped. I’m using the triangle drawing code, as I can’t rely on fonts being installed (I have no idea the reach this could go.) Plus the triangle that better represents the shape I need wasn’t part of unicode until 2014 and doesn’t exist in the font that Xojo on Windows uses for System. (the symbol)
I turned anti-aliasing off to find that point down, it drew better with the point at 4px instead of 5px from the left. It could be related to points/positioning within Xojo - but I do not know.
I literally spent the last 10 minutes adjusting points and re-trying to get it to look right. I cheated the anti-aliased flat side by drawing it -1px off the top so it gets cut off.