博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
个人代码库のC#背景色渐变的功能
阅读量:6885 次
发布时间:2019-06-27

本文共 839 字,大约阅读时间需要 2 分钟。

///         /// 实现“背景色渐变”的功能。【尚不完善】        ///         ///         protected override void OnPaintBackground(PaintEventArgs e)        {            int y, dy;            //y=this.Height-this.ClientRectangle.Height;            y = this.ClientRectangle.Location.Y;            dy = this.ClientRectangle.Height / 256;            for (int i = 255; i >= 0; i--)            {                              Color c = new Color();                c = Color.FromArgb(Convert.ToInt32(textBox1.Text.ToString()), i,Convert.ToInt32(textBox2.Text.ToString()));                SolidBrush sb = new SolidBrush(c);                Pen p = new Pen(sb, 100);                e.Graphics.DrawRectangle(p,this.ClientRectangle.X, y, this.Width,y+dy);                y = y + dy;            }        }

转载于:https://www.cnblogs.com/AsionTang/archive/2010/11/20/1882814.html

你可能感兴趣的文章
5.31 dockrer
查看>>
FreeCodeCamp----Intermediate Algorithm Scripting解法
查看>>
软件工程第二章 习题2 第4题
查看>>
《JavaScript设计模式与开发实践》读书笔记之命令模式
查看>>
hdu Problem 1242 Rescue bfs + 优先队列
查看>>
HDU-1507-Uncle Tom's Inherited Land*
查看>>
force里面的射线检测
查看>>
oracle 12.1.0.2中对象锁对系统的较大影响
查看>>
tensorboard的使用
查看>>
java进程占用CPU资源过高分析脚本
查看>>
day17--JQuery实例
查看>>
0312-css样式(选择器、文本text、字体fonts、背景background)
查看>>
【BZOJ】4358: permu 莫队算法
查看>>
【AtCoder】ARC092 D - Two Sequences
查看>>
Android系统架构与系统源码目录
查看>>
Hash链表
查看>>
我总结的iOS开发中的几个小坑
查看>>
PS2 连接SMB(网线连电脑)和连接USB小记
查看>>
通过Web Deploy方式部署WCF
查看>>
使用xfire工具搭建webservice
查看>>