对API较熟悉的兄弟伙来帮我看看这样的效果应该怎样实现。

tank_2009 2009-09-03 02:20:34
如图:
一张图片,图片四周有羽化效果(我不知道这样称呼是否准确)

不知道用什么API可以实现,麻烦给个DEMO。谢啦
...全文
103 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
tank_2009 2009-09-03
  • 打赏
  • 举报
回复
学习了。非常谢谢6,7楼两位朋友 ,万分感觉 。
MOmo400 2009-09-03
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 zgke 的回复:]
Bitmap _Bitmap = new Bitmap(@"C:\1.bmp");

            Graphics _Graphcis = Graphics.FromImage(_Bitmap);


            Point _Left1 = new Point(0, 0);
            Point _Left2 = new Point(_Bitmap.Width, 0);
            Point _Left3 = new Point(_Bitmap.Width , _Bitmap.Height/2);
            Point _Left4 = new Point(0, _Bitmap.Height/2);

            Point[] _Point = new Point[] { _Left1, _Left2, _Left3, _Left4 };
            PathGradientBrush _SetBruhs = new PathGradientBrush(_Point, WrapMode.TileFlipY);
            _SetBruhs.CenterPoint = new PointF(0, 0);
            _SetBruhs.FocusScales = new PointF(_Bitmap.Width/2, 0);
            _SetBruhs.CenterColor = Color.FromArgb(250, 255, 255, 255);
            _SetBruhs.SurroundColors=new Color[]{Color.FromArgb(100,255,255,255)};

            _Graphcis.FillRectangle(_SetBruhs, new Rectangle(0, 0, _Bitmap.Width, _Bitmap.Height));

            pictureBox1.Image=_Bitmap;
[/Quote]

UP
zgke 2009-09-03
  • 打赏
  • 举报
回复
Bitmap _Bitmap = new Bitmap(@"C:\1.bmp");

Graphics _Graphcis = Graphics.FromImage(_Bitmap);


Point _Left1 = new Point(0, 0);
Point _Left2 = new Point(_Bitmap.Width, 0);
Point _Left3 = new Point(_Bitmap.Width , _Bitmap.Height/2);
Point _Left4 = new Point(0, _Bitmap.Height/2);

Point[] _Point = new Point[] { _Left1, _Left2, _Left3, _Left4 };
PathGradientBrush _SetBruhs = new PathGradientBrush(_Point, WrapMode.TileFlipY);
_SetBruhs.CenterPoint = new PointF(0, 0);
_SetBruhs.FocusScales = new PointF(_Bitmap.Width/2, 0);
_SetBruhs.CenterColor = Color.FromArgb(250, 255, 255, 255);
_SetBruhs.SurroundColors=new Color[]{Color.FromArgb(100,255,255,255)};

_Graphcis.FillRectangle(_SetBruhs, new Rectangle(0, 0, _Bitmap.Width, _Bitmap.Height));

pictureBox1.Image=_Bitmap;
ChrisAK 2009-09-03
  • 打赏
  • 举报
回复
那不是羽化...
只是以点击点为中心的alpha过渡填充.
tank_2009 2009-09-03
  • 打赏
  • 举报
回复
有人知道没?

只想知道怎样把图片处理成四周带羽化的效果。
giszp 2009-09-03
  • 打赏
  • 举报
回复
看不懂,灌水好了!
tank_2009 2009-09-03
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zgke 的回复:]
这个用GDI+好做...没必要使用API了把
[/Quote]

谢谢,GDI+也行,只要实现这效果就好。用什么方法呢?
tank_2009 2009-09-03
  • 打赏
  • 举报
回复
上图效果是XP在拖动被选中文件时的效果。现在想仿做一个。
zgke 2009-09-03
  • 打赏
  • 举报
回复
这个用GDI+好做...没必要使用API了把

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧