SetRgnRoundRect example for Delphi
procedure TForm1.Button1Click(Sender: TObject);
var
{Declare local variables.}
OffsetX, OffsetY: integer;
begin
{Initialize the variables that we will manipulate to simulate mouse coordinates.}
OffsetX := Lead1.BitmapWidth div 8;
OffsetY := Lead1.BitmapHeight div 6;
{Create an elliptical region.}
Lead1.SetRgnRoundRect(OffsetX, OffsetY, OffsetX, OffsetY, OffsetX div 4 , OffsetY div 4 , L_RGN_SET);
Lead1.RgnFrameType:= ftStatic;
{Apply Emboss effect on the bitmap region }
Lead1.Emboss(EMBOSS_E,600);
{Repaint the image so that we can see how the image was updated.}
Lead1.ForceRepaint;
end;