C#程序设计
编程中怎样获取透明色啊!!!我是想绘制泡泡,求高人指点,不胜感激,感激涕零。。。 --------------------编程问答-------------------- Color.Transparent喜欢泡泡的 boy or girl --------------------编程问答-------------------- 顶楼上的
确实是透明色 --------------------编程问答--------------------
把你要的COLOR属性=Color.Transparent --------------------编程问答-------------------- 泡泡
O(∩_∩)O --------------------编程问答-------------------- 设置Color属性就行了 --------------------编程问答-------------------- Transparent[træns'perənt] 【词典解释】:形容词 a. 1. 透明的;清澈的[Z] 2. 显而易见的;一目了然的 --------------------编程问答-------------------- Color.Transparent
解析:
颜色的父容器的颜色!即自己要透明! --------------------编程问答-------------------- 试了一下没有达到预想效果:
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(30, 30, 180,180);
PathGradientBrush path = new PathGradientBrush(gp);
path.CenterColor = Color.Transparent;
path.SurroundColors = new Color[] { Color.Blue };
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(path, 30, 30,180,180);
path.Dispose();
} --------------------编程问答-------------------- 可以用ARGB的颜色,改变alpha的值可以设置透明或半透明。
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsPath gp = new GraphicsPath();
gp.AddEllipse(30, 30, 180, 180);
PathGradientBrush path = new PathGradientBrush(gp);
path.CenterColor = Color.FromArgb(0, 255, 255, 255);
path.SurroundColors = new Color[] { Color.FromArgb(180,0,0,255) };
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillEllipse(path, 30, 30, 180, 180);
path.Dispose();
}
试试看,不知道行不行 --------------------编程问答-------------------- 试了一下 和八楼的代码效果一样 郁闷。。。 --------------------编程问答-------------------- 你设置个全透明的alpha值作甚? --------------------编程问答-------------------- 1楼的貌似很凶!!!!! --------------------编程问答-------------------- 我想绘制泡泡 望大家帮帮忙。观察了一下,这个泡泡是一个颜色到透明的渐变。。。但不知是怎样做到的。。
补充:.NET技术 , C#