FixedDocument页面大小 [英] FixedDocument page size

查看:225
本文介绍了FixedDocument页面大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从网络上提取图像并将其添加到FixedDocument页面.我要拉的图像的尺寸为1200px X 1500px.但是,在FixedDocument中,图像显示为小缩略图(请参见屏幕抓图).

I am pulling an image from the web and adding it to a FixedDocument page. The image that I am pulling has dimension size of 1200px X 1500px. However in the FixedDocument the image appears as a small thumbnail (please see the screen grab).

下面是代码段.

FixedDocument fd = new FixedDocument();

BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"http://www.example.com/image.jpg", UriKind.Absolute);
bi.EndInit();
Image i = new Image();
i.Source = bi;

FixedPage fixedPage = new FixedPage();
fixedPage.Children.Add(i);                

PageContent pageContent = new PageContent();
(pageContent as IAddChild).AddChild(fixedPage);
fd.Pages.Add(pageContent);

我需要图片按照其尺寸而不是缩略图显示.请有人让我知道根据图像尺寸显示图像需要做什么吗?

I need the image to appear as per its dimensions and not as a thumbnail. Please can someone let me know what needs to be done to show the image as per its size?

非常感谢.

推荐答案

您的代码与大图像.

您可以在 BitmapSource.DownloadCompleted 事件处理程序,以查看您是否获得了想要的东西.

You could cross check the image size in a BitmapSource.DownloadCompleted event handler to see if you got what you wanted.

尽管,我无法解释为什么图像大小会与您期望的有所不同.据我所知,JPEG图像文件可以包含缩略图以进行快速预览.也许您的服务器正在提供这样的缩略图?

Although, i would have no explanation why the image size would differ from what you expect. As far as i know JPEG image files can contain thumbnail images for fast preview. Perhaps your server is delivering such a thumbnail?

这篇关于FixedDocument页面大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆