TPrintPreview very thin lines

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TPrintPreview very thin lines

Postby Fenistil » October 8th, 2009, 11:07 am

Hi!

I use your Printpreview component for a while, and it's very good, but now I have a problem with it :(

I want to print barcodes generated by an own barcode drawing unit. Because thees are partially custom barcodes, I can't use any TTF solution. So the problem is, that the thinnest line in the barcode should be only 0,2 mm width. Now I use mmHiMetric units, so I need to print a rectangle like this:
Code: Select all
PrintPreview.Canvas.Rectangle(2000,2000,2020,2500);

But I don't see any rectangle below the width of 30 units. (not 30 mm, 30 printing units). When I send it directly to a printer, it can print it, and the barcodes are perfect. So I make my barcode unit, that when I print a barcode in preview mode, it prints a dummy barcode, that can be seen (with 0,3 mm line width). It's OK, but then I tried to save it to PDF (with 0,2mm lines), and I realized that in the PDF I also can't see any 0,2 mm thick line, because the Printpreview can't draw it onto its canvas :(

What can I do now?

(I use 4.80, but I tried it in 5.14 also, it's the same).

Regards,

Fenistil
Fenistil
Member
Member
 
Posts: 1
Joined: January 9th, 2009, 12:16 pm

Re: TPrintPreview very thin lines

Postby Kambiz » October 8th, 2009, 3:37 pm

Hi,

You can use the following code to draw a line with 0.2mm thickness:

Code: Select all
PrintPreview.Canvas.Pen.Width := 20;
PrintPreview.Canvas.MoveTo(2000, 2000);
PrintPreview.Canvas.LineTo(2000, 2500);
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: TPrintPreview very thin lines

Postby Kambiz » October 8th, 2009, 5:39 pm

Sorry, I forgot to tell why you cannot draw a rectangle with that size.

In a 96 DPI screen, we can have 96 pixels in 25.4 mm. That means width of a pixel in 96 DPI screen is 0.26 mm. Therefore a display driver may do not draw a line less than 0.26 mm length.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

cron