谢谢德文!这是我的C#代码来实现你的建议。它工作得很好。把它变成一个社区拥有的Wiki帖子,如果有人喜欢添加一些代码,请随意编辑它。
(示例使用Alpha和不同价值观的曝光比下面的代码)
Image img = Image.FromFile("rss-icon.jpg");
pictureBox1.Image = AddCircularGloss(img, 30,25,255,255,255);
public static Image AddCircularGloss(Image inputImage, int exposurePercentage, int transparency, int fillColorR, int fillColorG, int fillColorB)
{
Bitmap outputImage = new Bitmap(inputImage);
using (Graphics g = Graphics.FromImage(outputImage))
{
using (Pen p = new Pen(Color.FromArgb(transparency, fillColorR, fillColorG, fillColorB)))
{
// Looks jaggy otherwise
g.SmoothingMode = SmoothingMode.HighQuality;
g.CompositingQuality = CompositingQuality.HighQuality;
int x, y;
// 3 * Height looks best
int diameter = outputImage.Height * 3;
double imgPercent = (double)outputImage.Height/100;
x = 0 - outputImage.Width;
// How many percent of the image to expose
y = (0 - diameter) + (int)(imgPercent * exposurePercentage);
g.FillEllipse(p.Brush, x, y, diameter, diameter);
}
}
return outputImage;
}
(约翰的建议后变了,我不能,虽然处理位图,这必须由完成函数的调用者)
好指针玩笑。 – TonyOssa 2008-09-21 00:59:12
这里是[一个Photoshop教程](http://www.redcultur.com/silkypixel/2008/01/11/tutorial-on-how-to-make-an-iphone-esque-gui-icon/),显示过程 – 2008-09-20 23:46:55
您的第一个示例图片已损坏,链接已死? – rene 2016-06-01 13:35:34