Hello everyone,
Happy Chritmas, frohe Weihnachten, und so weiter...
About drawing a real ruler in centimeters.
I use Erel's sub (below):
physical dimensions (post #4). But when I control my rulers...
I observe that 1 cm is really 0.95 cm on my screen (see the screen capture)
The code for the horizontal ruler is this following one:
What do I have to modify to obtain the correct dimensions for the X ans Y rulers ?
Happy Chritmas, frohe Weihnachten, und so weiter...
About drawing a real ruler in centimeters.
I use Erel's sub (below):
physical dimensions (post #4). But when I control my rulers...
I observe that 1 cm is really 0.95 cm on my screen (see the screen capture)
The code for the horizontal ruler is this following one:
ruler X:
Sub tracerReglex
'Dim ratx As Double=xdpi*2.54/xcm' exactsize=pixels per cm
'xcm=(Round2((100%x/xdpi*2.54),2))=largeur de l'écran
Dim ratx As Double=xdpi/(xcm/2.54)
cvsg.Initialize(pnlreglex)
Dim n As Int=0
Dim st As Int=(ratx/10)*1'dpi/mm
For x=100 To 3500 Step (st*10)'cm
cvsg.DrawLine(x,1dip,x,30dip,Colors.black,1dip)
Dim lbr As Label
lbr.Initialize("")
lbr.TextSize=10
lbr.TextColor=Colors.Black
If n=3 Then
lbr.Text=n & " cm"
Else
lbr.Text=n
End If
pnlreglex.addview(lbr,x+2dip,20dip,60dip,30dip)
n=n+1
Next
For x=100 To 3500 Step (st*5)'demi cm
cvsg.DrawLine(x,1dip,x,20dip,Colors.black,1dip)
Next
For x=100 To 3500 Step (st)'mm
cvsg.DrawLine(x,1dip,x,10dip,Colors.black,1dip)
Next
End Sub
What do I have to modify to obtain the correct dimensions for the X ans Y rulers ?