What’s the best way to handle the drawing (e.g. custom controls) in HiDPI mode?
I want to have pixel exact drawing for our custom controls.
Is it the best way to get the ScaleFactor reset the ScaleX and ScaleY to 1 and then multiply all values with the scalefactor?
See screenshot below.
Code for the left side (normal drawing):
[code]Dim Width As Integer = 50
Dim Height As Integer = 10
g.ForeColor = &cff0000
Dim points(6) as Integer
points(1)=10
points(2)=5
points(3)=40
points(4)=40
points(5)=5
points(6)=60
g.DrawPolygon points
g.DrawLine 10, 50, Width, 50
g.FillRect 10, 60, 1, 1[/code]
Code for the right side (regarding the ScaleFactor):
[code]
Dim Scaling As Double = Self.ScaleFactor
Dim Width As Integer = 50
Dim Height As Integer = 10
g.ScaleX = 1
g.ScaleY = 1
g.ForeColor = &cff0000
Dim points(6) as Integer
points(1)=10 * Scaling
points(2)=5 * Scaling
points(3)=40 * Scaling
points(4)=40 * Scaling
points(5)=5 * Scaling
points(6)=60 * Scaling
g.DrawPolygon points
g.DrawLine 10 * Scaling, 50 * Scaling, Width * Scaling, 50 * Scaling
g.FillRect 10 * Scaling, 60 * Scaling, 1, 1[/code]