WONG BODOH NGAKU PINTER
Minggu, 15 Juli 2012
tcolordialog to RGB delphi
cara merubah tcolor ke rgb adalah dengan cara memanfaatkan funsi
GetRValue(); GetGValue() GetBValue();
untuk penulisannya bisa dilihat dibawah :
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) ColorDialog1: TColorDialog; Button1: TButton; Label1: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var red,green,blue : integer; begin if ColorDialog1.Execute then begin red:=GetRValue(ColorDialog1.Color); green:=GetGValue(ColorDialog1.Color); blue:=GetBValue(ColorDialog1.Color); label1.Caption:='red[ '+IntToStr(red)+' ] / green[ '+IntToStr(green)+' ] / blue[ '+IntToStr(blue)+' ]'; end; end; end.
download source code
Tidak ada komentar:
Posting Komentar
Posting Lebih Baru
Posting Lama
Beranda
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar