乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      TColor 與 RGB 的互轉(zhuǎn)

       aaie_ 2012-10-11

      先曬個圖^_^

      unit Unit1;
        
      interface
        
      uses
        Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
        Dialogs, StdCtrls;
        
      type
        TForm1 = class(TForm)
          Edit1: TEdit;
          GroupBox1: TGroupBox;
          StaticText1: TStaticText;
          Edit2: TEdit;
          Edit3: TEdit;
          Edit4: TEdit;
          Label1: TLabel;
          Label2: TLabel;
          Label3: TLabel;
          Button1: TButton;
          Button2: TButton;
          Button3: TButton;
          Button4: TButton;
          procedure Button1Click(Sender: TObject);
          procedure Button2Click(Sender: TObject);
          procedure Button3Click(Sender: TObject);
        private
          { Private declarations }
        public
          { Public declarations }
        end;
        
      var
        Form1: TForm1;
        
      implementation
        
      {$R *.dfm}
      var
        c:TColor;
      procedure TForm1.Button1Click(Sender: TObject); //TColor轉(zhuǎn)RGB
      begin
        c:=StringToColor(Edit1.Text);
        Edit1.Color:=c;
        Edit2.Text:='$' + IntToHex(GetRValue(c),2);
        Edit3.Text:='$' + IntToHex(GetGValue(c),2);
        Edit4.Text:='$' + IntToHex(GetBValue(c),2);
      end;
        
      procedure TForm1.Button2Click(Sender: TObject); //RGB轉(zhuǎn)TColor
      var
        str:string;
        r,g,b:Byte;
      begin
          R:=StrToInt(Edit2.Text);
          G:=StrToInt(Edit3.Text);
          B:=StrToInt(Edit4.Text);
        
        str:='$00' + IntToHex(b,2) + IntTohex(g,2) + IntTohex(r,2);
        Edit1.Color:=StrToInt(str);
        Edit1.Text:=str;
      end;
        
      procedure TForm1.Button3Click(Sender: TObject);//清空(不是真的清空,只是懶得每次都輸入'$'這個符號)
      begin
      Edit1.Text:='$';
      Edit2.Text:='$';
      Edit3.Text:='$';
      Edit4.Text:='$';
      end;
      end.

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多