public void addTextToImage(string addText,LeadRectD lrd, double fontSize)
{
AnnTextObject text = new AnnTextObject();
text.Stroke = null;//没有边框
text.Text = addText;
text.Font = new AnnFont("Arial", fontSize);
text.Fill = null;
text.Rect = lrd;//.ToLeadRectD();
text.TextForeground = AnnSolidColorBrush.Create("Black");
Automation.Container.Children.Add(text);
Automation.Invalidate(LeadRectD.Empty);
Automation.SelectObject(text);
}
iiWidth = imageViewer1.Image.ImageWidth;
iiHeight = imageViewer1.Image.ImageHeight;
imageLeft = (iiWidth / 2) - 30;
imageTop = iiHeight - 30;
LeadRectD newLrD2 = LeadRectD.Create(imageLeft * 720, imageTop * 720, 700, 400);
addTextToImage("原件模糊", newLrD2, 12);
//固化
fixedAnnonation();
====================================================================================
这么一做后,文字添加不上去,只有图像的页码数添加在图像右下角,而我的意图,是将文字添加到下端正中,这是怎么回事?
|
|