TImage with rounded corners lazarus / 39-Graphics ---------------------------------------------------------------------- codeman · 2022-04-30 16:44 Hi ALL How can i display a picture from file with rounded cornders? I want to display img1 (see on attachments) like img2 with rounded corners, i cant find the way, any help is appreciated, thanks! I get rounded image but its empty.. Code: [Select]     img2.Picture.LoadFromFile('..');      img2.Picture.Bitmap.SetSize(img2.Width, img2.Height);      img2.Transparent:= True;      img2.Picture.Bitmap.TransparentColor:=$FFFEFD;      img2.Canvas.Brush.Color:=$FFFEFD;      img2.Canvas.FillRect(0, 0, img2.Width, img2.Height);      //img2.Canvas.Brush.Color:=clBlack;      //img2.Canvas.Pen.Color:=clBlack;      img2.Canvas.RoundRect(0, 0, img2.Width, img2.Height, 50, 50); ---------------------------------------------------------------------- jamie · 2022-04-30 17:07 I think what you are looking for is a region applied to the canvas. First look here https://lazarus- ccr.sourceforge.io/docs/lcl/lclintf/createroundrectrgn.html Create the surface area you wish and then apply it to the canvas you are drawing on, then draw the image to it. The corners will be excluded from the drawing and give you a rounded corner results. but then again, I maybe off on another planet. ---------------------------------------------------------------------- paweld · 2022-04-30 19:27 try BGRABitmap: https://github.com/bgrabitmap/bgrabitmap/releases tutorials: https://wiki.freepascal.org/BGRABitmap_tutorial Sample code: 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.Button1Click(Sender: TObject);var  image, bmp: TBGRABitmap;begin  image := TBGRABitmap.Create('d:\bear.jpg');  bmp := TBGRABitmap.Create(image.Width + 1, image.Height + 1, panel1.Color);  bmp.FillRoundRectAntialias(0, 0, image.Width, image.Height, 15, 15, image);  bmp.RoundRectAntialias(1, 1, image.Width - 1, image.Height - 1, 15, 15, clBlack, 2);  image.Free;  bmp.Draw(panel1.Canvas, (panel1.Width - bmp.Width) div 2, (panel1.Height - bmp.Height) div 2, True);  bmp.Free;end; ---------------------------------------------------------------------- lainz · 2022-05-01 14:53 There's a component in BGRAControls, TBCRoundedImage.