Recent

Author Topic: dotted border  (Read 3807 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
dotted border
« on: July 24, 2012, 12:00:09 pm »
Hello guys, how do I add a dotted border to the edges of the image contained in the object TImage? So that when I save the image I retain the dotted border like I added a frame to your picture!
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: dotted border
« Reply #1 on: July 24, 2012, 12:44:22 pm »
Just draw to your images canvas.

eg. something like..  btw. I'm coding from memory, so might be some syntax errors etc.

Code: [Select]
begin
  with image1.picture.bitmap.canvas do
  begin
     brush.style := bsNone;
     pen.Style := psDot;
     pen.Color := clRed;
     rectangle(0,0,image1.picture.bitmap.width,image1.picture.bitmap.height);
  end;

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: dotted border
« Reply #2 on: July 24, 2012, 01:37:54 pm »
Thank you

Not: brush.style := bsNone;
but: brush.style := bsClear;
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018