GDI中颜色渐变 可以用 LinearGradientBrush bbr1 = new LinearGradientBrush(rc, Color.Red, Color.White, LinearGradientMode.Vertical);
他来解决 ,但 这种渐变 是从按钮顶上 一直渐变到最下面 ,
如果 要从最上渐变到中间 再重中间渐变到最下面 ,如何实现?
也就是说 现在要 让按钮最上和最下 都是白的 让中间是红的, 怎么弄?
他来解决 ,但 这种渐变 是从按钮顶上 一直渐变到最下面 ,
如果 要从最上渐变到中间 再重中间渐变到最下面 ,如何实现?
也就是说 现在要 让按钮最上和最下 都是白的 让中间是红的, 怎么弄?
解决方案 »
- Bitmap.LockBits 方法 (Rectangle, ImageLockMode, PixelFormat)锁定的区域有何用处?
- C#求助!
- combobox怎么绑定一个表的所有字段名啊。。。。
- 第一次使用WCF,不知道是不是配置文件有错,请进。
- 虚拟内存
- 求VS2005中文版下载地址
- 请问如何在<iframe>中动态加入链接
- winform如何关闭webBrowser控件弹出的ie窗口?
- 我下载的一个代码,编译出错,大家帮我看一下,我问了版主,他说没错,是不是我的编译器有问题啊,大家帮帮忙!一定给分。
- 点击DATAGRID数据区任何地方都让整行被选中加亮,怎么做?
- Windows Mobile 5下DataGrid 的滚动条被拖到或点击时会触发什么事件?
- 关于datagirdview 嵌套 新表的问题……急需啊~~~~~
Point _Left1 = new Point(0, 0);
Point _Left2 = new Point(button1.Width / 2, 0);
Point _Left3 = new Point(button1.Width / 2, button1.Height);
Point _Left4 = new Point(0, button1.Height); Point[] _Point = new Point[] { _Left1, _Left2, _Left3, _Left4 };
PathGradientBrush _SetBruhs = new PathGradientBrush(_Point, WrapMode.TileFlipXY);
_SetBruhs.CenterPoint = new PointF(0, 0);
_SetBruhs.FocusScales = new PointF(0, button1.Height);
_SetBruhs.CenterColor = Color.White;
_SetBruhs.SurroundColors = new Color[] { Color.Red}; _Graphics.FillRectangle(_SetBruhs, new Rectangle(0, 0, button1.Width, button1.Height));
_Graphics.Dispose();这样看看
只有这个来模拟PathGradientBrush
看我改的 Graphics _Graphics = Graphics.FromHwnd(button1.Handle);
Point _Left1 = new Point(0, 0);
Point _Left2 = new Point(0,button1.Height / 2);
Point _Left3 = new Point(button1.Width , button1.Height/ 2);
Point _Left4 = new Point(button1.Width,0); Point[] _Point = new Point[] { _Left1, _Left2, _Left3, _Left4 };
PathGradientBrush _SetBruhs = new PathGradientBrush(_Point, WrapMode.TileFlipXY);
_SetBruhs.CenterPoint = new PointF(0, 0);
_SetBruhs.FocusScales = new PointF(button1.Width,0);
_SetBruhs.CenterColor = Color.White;
_SetBruhs.SurroundColors = new Color[] { Color.Red }; _Graphics.FillRectangle(_SetBruhs, new Rectangle(0, 0, button1.Width, button1.Height));
_Graphics.Dispose();