예제 #1
0
        private static Image RenderImageContext(ImageRenderData imageRenderData)
        {
            var bitmapImage = new BitmapImage();
            bitmapImage.SetSource(imageRenderData.ImageStream);

            return new Image
                        {
                            Margin = imageRenderData.Margin,
                            VerticalAlignment = VerticalAlignment.Top,
                            HorizontalAlignment = HorizontalAlignment.Left,
                            Source = bitmapImage,
                            Width = imageRenderData.Width,
                            Height = imageRenderData.Height
                        };
        }
예제 #2
0
 private static ImageRenderData CreateImage(PageRenderData context, double offsetX, double top, ImageElement item,
                                            BookImage bookImage)
 {
     var imageContext = new ImageRenderData
                            {
                                Margin = new Thickness(offsetX + context.OffsetX, top + context.OffsetY, 0.0, 0.0),
                                Width = item.Width,
                                Height = item.Height,
                                ImageStream = bookImage.CreateStream()
                            };
     return imageContext;
 }