2015-12-05 19 views
0

我需要創造約200 JPG文件類似於someecards:將圖片與文字合併並保存到光盤。 (Someecards風格)

它們包括:

  • 背景JPG
  • 在一個角落裏PNG層1至5星
  • 需要適合特定區域的文本字符串。

我需要批量創建的3種元素組合成一個JPG

文件,我有CSV與文件名,文件明星, 「文本」

例如:review07,3,「這是平均的,但要注意xxx和yyy「

如何將上述元素合併爲一個JPG文件?

回答

0

使用下面的代碼在一個又一個繪製圖像:

using (Graphics grfx = Graphics.FromImage(image)) 
{ 
    grfx.DrawImage(newImage, x, y) 
} 

,你可以用下面的一段代碼在圖像寫入文本:

using(Graphics grfx = Graphics.FromImage(image)) 
{ 
    using (Font arialFont = new Font("Arial", 10)) 
    { 
     grfx.DrawString("Your Text", arialFont, Brushes.Blue, new PointF(10f, 10f)); 
    } 
} 
相關問題