CanvasVectorOutput & Unit
Posted: Sun Dec 18, 2022 7:05 am
Code: Select all
OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Inch))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Millimeter))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
StartVectorDrawing(CanvasVectorOutput(0, #PB_Unit_Point))
Debug ConvertCoordinateX(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputWidth()
Debug ConvertCoordinateY(399, 199, #PB_Coordinate_Device, #PB_Coordinate_User)
Debug VectorOutputHeight()
StopVectorDrawing()
;Repeat : Event = WaitWindowEvent() : Until Event = #PB_Event_CloseWindow
4.1562495231628418
4.166666666666667
2.0729165077209473
2.0833333333333335
105.56874084472656
105.83333333333333
52.652080535888672
52.916666666666664
299.24996948242187
300.0
149.24998474121094
150.0
SB -->
399
400
199
200
399
400
199
200
399
400
199
200
Is it a compiler error or incorrect documentation?
p.s.
I had plans to identify the device by screen size in millimeters.
It was a fiasco.