Recent Posts

Selamat datang di Coding Delphi Land Weblog kumpulan source code pemogram delphi

(Bukan maksud untuk menggurui tetapi marilah kita berbagi ilmu tuk perkembangan kemajuan teknologi kita

Selasa, 17 November 2009

Graphics To Bitmap

procedure GraphicToBitmap(const Src: Graphics.TGraphic;
const Dest: Graphics.TBitmap; const TransparentColor: Graphics.TColor);
begin
if not Assigned(Src) or not Assigned(Dest) then
Exit;
Dest.Width := Src.Width;
Dest.Height := Src.Height;
if Src.Transparent then
begin
Dest.Transparent := True;
if (TransparentColor <> Graphics.clNone) then
begin
Dest.TransparentColor := TransparentColor;
Dest.TransparentMode := Graphics.tmFixed;
Dest.Canvas.Brush.Color := TransparentColor;
end
else
Dest.TransparentMode := Graphics.tmAuto;
end;
Dest.Canvas.FillRect(Classes.Rect(0, 0, Dest.Width, Dest.Height));
Dest.Canvas.Draw(0, 0, Src);
end;

0 komentar:

Posting Komentar