Two pixels vertical line in canvas becomes one pixel. lazarus / 39-Graphics ---------------------------------------------------------------------- Fantablup · 2021-06-20 16:42 I was trying to create borders with lines in a TImage canvas. I also tried with drawing rectangle with insideFrame, but with same result. Also, using insideFrame is destroying everything else. The StretchDraw result in the canvas is not working then. The left line is always one pixel. Just can't make it two pixels. The pen with is 2. I read about it is a problem, but i can't find any solution. So, i dropped the border totally, because it is not sowing up nice. ---------------------------------------------------------------------- speter · 2021-06-20 23:33 Is it possible that you are too close to an edge of the canvas? If you use code something like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.PaintBox1Paint(Sender: TObject);const  x = 10;begin  with paintbox1.canvas do    begin      pen.width := 2;      line(x,10, x,100);    end;end; You will get a 2 pixel wide line. Note that if your X value is less than half the pen.width, the line will be clipped. For example something like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.PaintBox1Paint(Sender: TObject);const  x = 10;begin  with paintbox1.canvas do    begin      pen.width := 25;      line(x,10, x,100);    end;end; the code above will produce a clipped line... cheers S. ---------------------------------------------------------------------- Fantablup · 2021-06-20 23:41 Thanks speter I will test it out. I don't need it right now, but can do some testing anyway.