CanvasVectorOutput & Unit

Just starting out? Need help? Post your questions and find answers here.
User avatar
useful
Posts: 135
Joined: Tue Feb 25, 2014 1:15 pm

CanvasVectorOutput & Unit

Post by useful »

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
PB -->
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.
2B or not 2B = FF
User avatar
useful
Posts: 135
Joined: Tue Feb 25, 2014 1:15 pm

Re: CanvasVectorOutput & Unit

Post by useful »

Do I understand correctly that
#PB_Unit_Point
#PB_Unit_Inch
#PB_Unit_Millimeter
in SpiderBasic is not supported and you need to correct the documentation?

Or is this a bug?
2B or not 2B = FF
User avatar
useful
Posts: 135
Joined: Tue Feb 25, 2014 1:15 pm

Re: CanvasVectorOutput & Unit

Post by useful »

Am I the only one who cares about this?
2B or not 2B = FF
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: CanvasVectorOutput & Unit

Post by plouf »

welll vector drawing is not very popular , but we all want this fixed because sometime will needed :)

seems like a bug since Debug VectorUnit(), return correct unit is being set each time
Christos
Post Reply