2013-03-25 21 views
0

我使用下面的代码,而不是白色backgroung的我怎样才能的背景图像设定为在生成动态

System.Drawing.Image img = new Bitmap(300, 600); 

Graphics drawing = Graphics.FromImage(img); 

//paint the background 
drawing.Clear(System.Drawing.Color.White); 

//create a brush for the text 
Brush textBrush = new SolidBrush(textColor); 

drawing.DrawString(text, font, textBrush, 0, 0); 

drawing.Save(); 

textBrush.Dispose(); 
drawing.Dispose(); 

我想使用的图像(公司徽标)创建一些动态图像的图像,它就像水印一样。我怎样才能做到这一点?

回答

0

更改textBrush定义IKE看看这个:

int alpha = 128; // range from 0 (transparent) to 255 (opaque) 
Brush textBrush = new SolidBrush(Color.FromArgb(alpha, textColor); 
相关问题