Home Component Writing

Draw and print color line

edited October 2003 in Component Writing
Hi,

I have following code: (ARect is the area where I fill in the color and
draw the line on, ACanvas is the printer canvas.)

{ Fill the color in the rect area. }
ACanvas.Brush.Style := bsSolid;
ACanvas.Brush.Color := $008080FF;
ACanvas.FillRect(ARect);

{ draw a vertical color line }
ACanvas.Brush.Style := bsClear;
ACanvas.Pen.Width := 1;
ACanvas.Pen.Style := psSolid;
ACanvas.Pen.Color := clRed;

Windows.MoveToEx(ACanvas.Handle, ARect.Left + 4, ARect.Top, nil);
Windows.LineTo(ACanvas.Handle, ARect.Left + 4, ARect.Bottom, nil);


When it print to a non-color printer (e.g. Laser printer), it picks the
corresponding gray level color to fill the rect which is correct, but it
always pick the WHITE color to print the line in the rect area (no line
appears on the paper if the fill color is also white) even though the line
color is Red (or whatever non-black color). What am I missing?

Thanks

William

Comments

  • edited October 2003

    We have seen the same results in our testing. Colored lines does not work on
    most printers. I do not have an answer for this.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2003
    Hi, Nard

    Is the problem relate to the pen style and brush style, or fill style?

    William


This discussion has been closed.