我想按照這個article,很容易實現text over image
,現在我的問題是上面提到的文章中的圖片水印放入10像素從左所以如何將圖像放置在右上角,頂部中間,中間左側,中間,中間右側和相似處。水印圖像位置[asp.net]
這裏是它是如何放置到右上角:
int xPosOfWm = ((phWidth - wmWidth)-10);
int yPosOfWm = 10;
grWatermark.DrawImage(
imgWatermark,
new Rectangle(
xPosOfWm, yPosOfWm,
wmWidth, wmHeight
),
0, 0,
wmWidth, wmHeight,
GraphicsUnit.Pixel,
imageAttributes
);