请问如何做skin?人人有分的(200分)

A

apache

Unregistered / Unconfirmed
GUEST, unregistred user!
高分请教思路,请大家讨论
人人有分的
 
最好的是用ActiveSkin这个控件,
不过还要其他的很好的,delphi vcl 例如1st class
 
ActiveSkin是OCX。
建议用SkinEngine1.7版,1,8有不少毛病。
SkinEngin不少Skin,还带了一个SkinBuilder。
可到http://www.51delphi.com

呵呵,现在回答问题愈显专业了。
 
自己编程序用图拼起来,并不复杂!!!
 
是不是所有的按钮和标题栏,等等都要用图来做啊

那些控件的是不是原理就是这样啊
 
我觉得还是用activeskin比较方便!而且使用简单!就是要注册比较麻烦
 
最好用Delphi原生的VCL,要有Source Code。
 
用skinform控件.
 
尽可能的不太过多依赖第三方控件
 
ActiveSkin好。
混分的:)
 
真的要做的话当然要参考一下人家是怎么做的了。
我觉得SKINENGINE做得还可以,你可以下载下来看看它是怎么做的
不过应该比较麻烦![:D]
 
我也在研究
 
姑妄言之:
首先建立一个INI文件,保存设置换肤图象等相关路径信息。
然后通过loadfromfile读取图象文件及writestring读取INI文件信息。
 
你的美术创意才是最重要的。
 
Make your application skinable
Component Download: http://www.qwerks.com/download.asp?ProductID=2447

SkinForm is a component to help you make non-rectangle and skinable form,
just like the popular applications such as WinAMP, WPlay ...,
what took hours before can now be done in minutes! With the WYSIWYG
skin builder, you can make the script file quite easy. The component makes
it very easy to create a very complex and skinable form without any programming,
what you have to do is to create several pictures and drag your mouse to set
hot areas to place buttons, texts and track bars. There is even a preview at
design time!

The following features are available:
a.support bmp and jpeg files
b.support graphic button, including switch-style button, radio button
c.support text, graphic text and number
d.support graphic track bar
e.support multi skins, you can give a skin to each form of the application
f.support internal skins, skins can be stored in the resource file

It is very easy to create a skinable project:
- Make bitmap files for a skin
- Use Skin Builder to make a describe file
- Create a new project.
- Place a TSkinForm component on the form
- Compile it

Here is a script file made by SkinBuilder:
[VERSION]
Ver=210 // Version of skin description file

[BITMAPINFO]
MaskBitmap=PlayerMask.bmp
// Bitmap file of the mask, the shape of the form
MouseUpBitmap=PlayerMain.jpg
// Bitmap file of the form when mouse button is up
MouseDownBitmap=PlayerSel.jpg
// Bitmap file of the form when mouse button is down
MouseOnBitmap=PlayerSel.jpg
// Bitmap file of the form when mouse currsor is over [optional]
NumbersBitmap=
// Bitmap file of the graphic number [optional]
TextBitmap=
// Bitmap file of the graphic text [optional]

[HOTAREAINFO]
Count=19 // The total number of buttons
// Description of one button
// number=ID, top, left, width, height, hint [, button state, group name]
// Description in the [ ] is optional
1=BUTTON_PLAY, 54, 165, 34, 35, Play/Pause
2=BUTTON_STOP, 129, 165, 19, 35, Stop
3=BUTTON_NEXT, 90, 165, 18, 17, Next
4=BUTTON_PREV, 109, 165, 18, 17, Previous
...

[DISPLAYINFO]
Charset=1 // Charset of the text area
Count=3 // The total number of text areas
// Description if one text area
// number=ID, font name, bold, italic, size, color, top, left, style, default text, hint, width, height
1=TEXT_LEN, Arial, TRUE, FALSE, 9, $00366835, 116, 137, Normal, [00:00], Length, 51, 18
2=TEXT_POS, Arial, TRUE, FALSE, 12, $00366835, 55, 133, Normal, 00:00, Position, 52, 23
3=TEXT_SONG, MS Sans Serif, FALSE, FALSE, 7, $00366835, 56, 112, Normal, Song Name, Song Name, 111, 21

[TRACKBARINFO]
Count=2 // The total number of track bars
// Description if one track bar
// number=ID, trackbar bitmap file, trackbar bitmap file, top, left, length, style, position, hint
1=TRACKBAR_VOLUME, TrackBar.BMP, TrackBar.BMP, 79, 205, 88, H, 65, Volume
2=TRACKBAR_POS, TrackBar.BMP, TrackBar.BMP, 79, 217, 88, H, 0, Time

Yes, without any code, the application is skinable.
you can add you code to catch event of MouseUp, Down, Over ...

The following is sample code:
...
procedure TForm1.FormCreate(Sender: TObject);
begin
//Load a skin file
SkinForm1.LoadDefaultSkin;
SkinForm1.SetDisplayText('VOLUME', IntToStr(SkinForm1.GetTrackBarPos('TRACKBAR_VOLUME')));
SkinForm1.SetDisplayText('TIME', IntToStr(SkinForm1.GetTrackBarPos('TRACKBAR_POS')));
SkinForm1.SetTrackBarMinMax('TRACKBAR_VOLUME', 20, 80);
end;

procedure TForm1.SkinForm1MouseUpNotify(ID: String; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
pos : TPoint;
begin
if (Button = mbLeft) then
begin
if ID = 'BUTTON_EXIT' then
Close;
if ID = 'BUTTON_MINIMIZE' then
Form1.Perform(WM_SYSCOMMAND, SC_MINIMIZE, 0);

if ID = 'BUTTON_MENU' then
begin
pos := ClientToScreen(Point(X, Y));
PopupMenu1.Popup(pos.x, pos.y);
end;

end;

if (Button = mbRight) then
begin
pos := ClientToScreen(Point(X, Y));
PopupMenu1.Popup(pos.x, pos.y);
end;
...





 
ActiveSkin 挺好的 方便 傻瓜型
 
我以前写过,
用bitblt直接画
 
这里的高手很多
关注
 
接受答案了.
 
顶部