Got most of my hand-drawn stuff successfully converted to proper HiDPI. One small sub-project isn’t working in HiDPI. The icons are drawn non-HiDPI. What am I doing wrong?
From the Paint event:
[code]dim theWidth as Integer = 32
dim theHeight as Integer = 17
dim BaseOffSet as Integer = 3
dim thePicture as new Picture(me.Width, me.Height, 32)
thePicture.Graphics.ForeColor = RGB(233, 233, 233)
thePicture.Graphics.FillRect(0, 0, me.Width, me.Height)
if DaysOfTrialGone = 0 and NoOfDaysTrial = 0 then Return
'trial expired
if NoOfDaysTrial - DaysOfTrialGone <= 0 then
for currentDay as Integer = 0 to NoOfDaysTrial - 1
thePicture.Graphics.DrawPicture button_red, (theWidth + 2) * currentDay + BaseOffSet, 2 + BaseOffSet
next
else
'trial ongoing
dim Rest as double = DaysOfTrialGone / NoOfDaysTrial
for currentDay as Integer = 0 to DaysOfTrialGone - 1
If (Rest >= 0.75) then
thePicture.Graphics.DrawPicture button_red, (theWidth + 2) * currentDay, 0
ElseIf (Rest >= 0.5) then
thePicture.Graphics.DrawPicture button_yellow, (theWidth + 2) * currentDay, 0
elseif (Rest < 0.5) then
thePicture.Graphics.DrawPicture button_green, (theWidth + 2) * currentDay, 0
end if
next
for currentDay as Integer = DaysOfTrialGone to NoOfDaysTrial - 1
thePicture.Graphics.DrawPicture button_grey, (theWidth + 2) * currentDay, 0
next
end if
g.DrawPicture thePicture, 0, 0[/code]
Test project is available at https://www.mothsoftware.com/downloads/Thermometer.zip . Open, click button to test.