| Mengkonversi Icon ke BMP |
|
|
|
| Delphi - Tips dan Trik Delphi |
|
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var Ikon : TIcon; Bitmap : TBitmap; begin Ikon:=TIcon.create; Bitmap:=TBitmap.create; Ikon.LoadFromFile('C:\Data\Iconku.ico'); Bitmap.Height := Ikon.Height; Bitmap.Width := Ikon.Width; Bitmap.Canvas.Draw(0, 0, Ikon); Bitmap.SaveToFile('C:\Data\Iconku.bmp'); Ikon.Free; Bitmap.Free; end; end. |














