print pixels in certain positions
Posted: Fri Mar 18, 2022 9:24 am
I am trying to print pixels in certain positions
If on the screen the position is x = 4.2 and y = 21.40 multiplied by an n = 10.8 in the printout I cannot center the exact position
in the image you see I put the image below just to help me but in printing it is not printed also because in the printer I put the receipts as sheets of paper

I built a grid to understand what the exact position is compared to the one shown in the video but I didn't understand how to do it
On dialog I have this

what mathematical operation should I do to print the pixel in the right position?
I tried to print a Box having the same measure
But the pixel is printed at this position

see this image

the circle with the number "1" is at 4.2 with respect to the left side of the receipt, and at 21.40 with respect to the top of the receipt
the measurements are expressed in millimeters
in the picture the horizontal distance between boxes is 5.45 and the vertical distance is 3.9
Any solution please ?
If on the screen the position is x = 4.2 and y = 21.40 multiplied by an n = 10.8 in the printout I cannot center the exact position
in the image you see I put the image below just to help me but in printing it is not printed also because in the printer I put the receipts as sheets of paper

I built a grid to understand what the exact position is compared to the one shown in the video but I didn't understand how to do it
On dialog I have this

what mathematical operation should I do to print the pixel in the right position?
I tried to print a Box having the same measure
Code: Select all | Expand
function PrintPixel(oPrn)
local nRow:=4.2
Local ncol:= 21.4
local nRapporto := 3.9
local x,y
local nWidth := 2
local nHeight := 2
local oBrushBlack
nRow += 0.1 * nRapporto
nCol += 0.1 * nRapporto
nWidth -= 0.1
nHeight -= 0.2
DEFINE BRUSH oBrushBlack COLOR CLR_BLACK
oPrn:Box(nRow, nCol, nRow + nHeight,nCol + nWidth, ,oBrushBlack,, "MM" )// { cText, oFontSmall2, nColortext1 }
return nil
But the pixel is printed at this position

see this image

the circle with the number "1" is at 4.2 with respect to the left side of the receipt, and at 21.40 with respect to the top of the receipt
the measurements are expressed in millimeters
in the picture the horizontal distance between boxes is 5.45 and the vertical distance is 3.9
Any solution please ?