12-03-2013, 11:09 AM
إقتباس :لان الصوره من نوع Jpgتفضل :
PHP كود :
function FrameBitmap(srcbmp:TGraphic;out DstBmp:TBitmap; const FrameColor:TColor=clBlack;FrameWidth:Integer=0):TBitmap;
var
w:integer;
begin
if not Assigned(DstBmp) then
DstBmp:=TBitmap.Create;
DstBmp.Width :=srcbmp.Width ;
DstBmp.Height:=srcbmp.Height ;
DstBmp.Canvas.Draw(0,0,srcbmp);
DstBmp.Canvas.Brush.Color:= FrameColor;
DstBmp.Canvas.Pen.Color:= FrameColor;
if FrameWidth <>0 then
begin
for w := 0 to FrameWidth do
DstBmp.Canvas.FrameRect(Rect(w,w,DstBmp.Width-w,DstBmp.Height-w));
end else
DstBmp.Canvas.FrameRect
(Rect(0,0,DstBmp.Width,DstBmp.Height));
Result:= DstBmp;
end;
الاستعمال :
PHP كود :
var bmp:TBitmap ;
begin
bmp:=TBitmap.Create;
Self.Image2.Picture.Graphic:=FrameBitmap(Self.Image1.Picture.Graphic,bmp,clRed,4);
bmp.Free;
end;

