-
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%的代码片段,完整代码需下载后查看 加载中 侵权举报
- 2023-07-25 02:55:04下载
- 积分:1
-
功能相当强大,大家自己看看就知道了,不知道以前用过没有啊...
功能相当强大,大家自己看看就知道了,不知道以前用过没有啊-Quite strong, everyone could see for himself know, I do not know previously used no ah
- 2022-01-21 04:52:44下载
- 积分:1
-
创建超级连接的程序,用VC实现的。类似于网页中的link。
创建超级连接的程序,用VC实现的。类似于网页中的link。-Procedures for the creation of super-connectivity with VC achievable. Similar pages link.
- 2022-05-12 19:51:23下载
- 积分:1
-
software engineering process document only reference, I hope you will thank usef...
软件工程流程文档 仅供大家参考,希望你能用得上 -software engineering process document only reference, I hope you will thank useful
- 2022-03-03 02:29:45下载
- 积分:1
-
这是一个用按钮来控制小女孩跳舞的速度的程序实例.
这是一个用按钮来控制小女孩跳舞的速度的程序实例.-This is a button used to control the girl to dance speed examples of procedures.
- 2022-02-02 14:02:26下载
- 积分:1
-
This algorithm is a procedure. Builder 6.0 in the C compiler through.
这是一个算法实现程序. 在C++Builder 6.0编译通过.-This algorithm is a procedure. Builder 6.0 in the C compiler through.
- 2022-05-25 14:51:06下载
- 积分:1
-
自绘制XP风格的按钮
自绘制XP风格的按钮-XP style button
- 2022-02-04 22:58:21下载
- 积分:1
-
The examples on the use of control messages TAG attribute.
本实例主要介绍使用控件的TAG属性传递信息。-The examples on the use of control messages TAG attribute.
- 2023-06-29 15:10:03下载
- 积分:1
-
从Static派生,可以任意改变静态文本背景颜色和字体的颜色。...
从Static派生,可以任意改变静态文本背景颜色和字体的颜色。-derived from Static can arbitrarily change the static text background color and font colors.
- 2022-03-18 13:02:20下载
- 积分:1
-
使你对按钮控件的使用有更深入的了解,以便应用于实际当中...
使你对按钮控件的使用有更深入的了解,以便应用于实际当中-This code may be freely distributable in any application. Ifyou make any changes to the source, please let me know so thatI might make a better version of the class.
- 2022-04-16 23:48:54下载
- 积分:1