程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> Delphi >> Delphi制作的鏡框效果

Delphi制作的鏡框效果

編輯:Delphi

Delphi制作的鏡框效果,可選擇多種不同的顏色相框,類似於窗口的換膚功能。在相框上點擊右鍵,可選擇圖片等。示例效果圖所示:

迷你相冊delphi相框

vIEw source print? 01 unit Unit1; 02 interface 03 uses 04   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 05   Dialogs, StdCtrls, ExtCtrls, jpeg, Menus, ExtDlgs,INIFILES; 06 type 07   TForm1 = class(TForm) 08     PopupMenu1: TPopupMenu; 09     N1: TMenuItem; 10     Panel1: TPanel; 11     Image1: TImage; 12     Label1: TLabel; 13     Label2: TLabel; 14     N2: TMenuItem; 15     N3: TMenuItem; 16     N4: TMenuItem; 17     N5: TMenuItem; 18     N6: TMenuItem; 19     N7: TMenuItem; 20     OpenPictureDialog1: TOpenPictureDialog; 21     procedure N1Click(Sender: TObject); 22     procedure N2Click(Sender: TObject); 23     procedure FormCreate(Sender: TObject); 24     procedure N4Click(Sender: TObject); 25     procedure N5Click(Sender: TObject); 26     procedure N6Click(Sender: TObject); 27   private 28  procedure WMNCHitTest(var Msg:TWMNCHitTest);message WM_NCHITTEST; 29   public 30     { Public declarations } 31   end; 32 var 33   Form1: TForm1; 34   theme:TInifile; 35   themename,form_color,panel_color,Label_color:string; 36 implementation 37 {$R *.dfm} 38 procedure TForm1.WMNCHitTest(var Msg:TWMNCHitTest); 39 begin 40 DefaultHandler(Msg); 41 if Msg.Result = HTCLIENT then 42 Msg.Result:= HTCAPTION; 43 end; 44 procedure TForm1.N1Click(Sender: TObject); 45 begin 46 Close;//退出程序 47 end; 48 procedure TForm1.N2Click(Sender: TObject); 49 begin 50 If OpenPictureDialog1.Execute Then 51  Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); //載入圖象文件 52 end; 53 procedure TForm1.FormCreate(Sender: TObject); 54 begin 55 Theme:=TIniFile.Create('themes.ini'); 56 end; 57 procedure TForm1.N4Click(Sender: TObject); 58 begin 59 Label2.Caption:=theme.ReadString('theme1','name','濃烈型'); 60 Form1.Color:=StringToColor(theme.ReadString('theme1',form_color,'clPurple')); 61 panel1.Color:=StringToColor(theme.ReadString('theme1',panel_color,'clMaroon')); 62 Label2.Font.Color:=StringToColor(theme.ReadString('theme1',Label_color,'clwhite')); 63 end; 64 procedure TForm1.N5Click(Sender: TObject); 65 begin 66 Label2.Caption:=theme.ReadString('theme1','name','清新型'); 67 Form1.Color:=StringToColor(theme.ReadString('theme1',form_color,'$00EC83F1')); 68 panel1.Color:=StringToColor(theme.ReadString('theme1',panel_color,'$00F365BA')); 69 Label2.Font.Color:=StringToColor(theme.ReadString('theme1',Label_color,'clBlue')); 70 end; 71 procedure TForm1.N6Click(Sender: TObject); 72 begin 73 Label2.Caption:=theme.ReadString('theme1','name','古樸型'); 74 Form1.Color:=StringToColor(theme.ReadString('theme1',form_color,'clBackground')); 75 panel1.Color:=StringToColor(theme.ReadString('theme1',panel_color,'clblack')); 76 Label2.Font.Color:=StringToColor(theme.ReadString('theme1',Label_color,'clwhite')); 77 end; 78 end.
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved