QRコードを含む画像付きのXPSドキュメントを印刷しています。画像作成サンプルはこちら:
Image image = CreatePresentation(qrCode);
image.Height = 200;
image.Width = 200;
image.HorizontalAlignment = HorizontalAlignment.Center;
image.VerticalAlignment = VerticalAlignment.Center;
image.Stretch = Stretch.None;
どこ
public static Image CreatePresentation(System.Drawing.Image source)
{
Stream stream = new MemoryStream();
source.Save(stream, ImageFormat.Png);
Image image = new Image();
BitmapImage src = new BitmapImage();
src.BeginInit();
src.StreamSource = stream;
src.EndInit();
image.Source = src;
return image;
}
モニターdpi = 96の場合、印刷ページ(印刷後の紙)の画像サイズは、モニターdpi = 120の場合よりも大きくなります。異なるdpiで同じサイズの画像を印刷するにはどうすればよいですか?