我想按照这个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
);