我在这里为一个小问题的解决方案。也许我还没有找到正确的东西,因为我没有找到解决方案,我希望你能够提供帮助。保存Controls.Image为PDF与多个1 Control.Image
所以我有一个WPF应用程序,我加载图像,在这里我没有问题。接下来,我必须通过点击添加一些点,所以我有这个功能:
private void ClickMouse(object sender, MouseButtonEventArgs e)
{
Point p = e.GetPosition(this);
schema.PointFromScreen(p);
var myImage3 = new Image();
var bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri(_clickImagePath, UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
myImage3.MinWidth = 30;
myImage3.MinHeight = 30;
myImage3.Width = 30;
myImage3.Height = 30;
myImage3.Name = _pointName;
var oMargin = new Thickness(p.X, p.Y, 0, 0);
myImage3.Margin = oMargin;
mainCanva.Children.Add(myImage3);
_listImg.Add(myImage3);
PointList.Items.Add(_pointName);
}
问题不在这里,但我需要一个上下文。
现在谈谈主要问题。我必须保存最终的图像来制作PDF。我使用了我在这里找到的一段示例代码(http://stackoverflow.com/questions/1824989/how-to-store-system-windows-controls-image-to-local-disk)来转换为使用jpg文件iTextSharp的。我对PDF的唯一印象就是第一张照片,所以我承认它可能只拍摄第一张图像,而不是其他创建的图像,但我真的不知道如何解决这个问题。是否存在一些功能来制作图像区域的截图?或者可能要关注主体Control.Image的区域中的所有图像?
谢谢你的帮助。