首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > GlowButton - 发光的按钮控件

GlowButton - 发光的按钮控件

资 源 简 介

翻译  maninwest@Codeforge  作者:John Underhill @ Codeproject最近我在查看 KMP Player 软件上的一些图形元素(如果你想看看好的图形设计,我建议你也查看一下)。我在项目中需要的是一个简单的发光按钮控件,用于玩家控制的,这不是什么太神奇的东西,只是在鼠标悬停时能够改变颜色。让图像更改颜色很简单,只需修改  ImageAttribute 的颜色矩阵:private void DrawColoredImage(Graphics g, Image img, Rectangle bounds, Color clr) { using (ImageAttributes ia = new ImageAttributes()) { ColorMatrix cm = new ColorMatrix(); // convert and refactor color palette cm.Matrix00 = ParseColor(clr.R); cm.Matrix11 = ParseColor(clr.G); cm.Matrix22 = ParseColor(clr.B); cm.Matrix33 = ParseColor(clr.A); cm.Matrix44 = 1f; // set matrix ia.SetColorMatrix(cm); // draw g.DrawImage(img, bounds, 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, ia); } }示例代码中的 ParseColor 会将位转化为浮点值。 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报

文 件 列 表

GlowButton Harness
bin
Debug
frmMain.cs
frmMain.Designer.cs
frmMain.resx
GlowButton Harness.csproj
Program.cs
Properties
Resources
bin
GlowButton
GlowButton.sln
GlowButton.suo
GlowButton
VIP VIP
0.186384s