get screen DPI.
Resize canvasgadget to a width of 210mm
Drawline 200mm long.
Canvas gadget shows with a width of 200mm and a little bit
the line is drawn with a length of 185mm more or less.
Are the vector graphics functions inaccurate?
Code: Select all
Global Window_0
Global Canvas_0,ScreenDPI
Macro mm2px(mm)
Round(ScreenDPI/25.4 * mm, #PB_Round_Nearest)
EndMacro
Procedure GetScreenDPI()
StartVectorDrawing(CanvasVectorOutput(Canvas_0,#PB_Unit_Pixel))
ScreenDPI = VectorResolutionX()
StopVectorDrawing()
EndProcedure
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu | #PB_Window_Maximize)
Canvas_0 = CanvasGadget(#PB_Any, 10, 10,100, 80)
GetScreenDPI()
ResizeGadget(Canvas_0, 10,10,mm2px(210),80)
StartVectorDrawing(CanvasVectorOutput(Canvas_0,#PB_Unit_Millimeter))
MovePathCursor(5,10)
AddPathLine(200,10)
StrokePath(1)
StopVectorDrawing()
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow