public override IExportColumn CreateExportColumn(){ var export = new ExportImage(); export.ToExportItem(this); export.Image = Image; export.ScaleImageToSize = ScaleImageToSize; return export; }
public virtual void Visit(ExportImage exportImage) { }
public override void Visit(ExportImage exportImage) { XImage image = XImage.FromGdiPlusImage(exportImage.Image); var location = PdfHelper.LocationRelToParent(exportImage); if (exportImage.ScaleImageToSize) { xGraphics.DrawImage(image, location.X.ToPoint(), location.Y.ToPoint(), exportImage.Size.Width.ToPoint(),exportImage.Size.Height.ToPoint()); } else { xGraphics.DrawImage(image, location.X.ToPoint(), location.Y.ToPoint(), exportImage.Image.Size.Width.ToPoint(),exportImage.Image.Size.Height.ToPoint()); } }
public override void Visit(ExportImage exportImage) { var visual = new DrawingVisual(); using (var dc = visual.RenderOpen()){ var iss = ToBitmapSource(exportImage.Image); dc.DrawImage(iss,new Rect(exportImage.Location.ToWpf(), new Size(exportImage.Size.Width,exportImage.Size.Height))); } var drawingElement = new DrawingElement(visual); UIElement = drawingElement; }