2013-04-18 4 views
0

QR 코드가 포함 된 이미지가있는 XPS 문서를 인쇄합니다. 여기 이미지 생성 샘플 :이미지가있는 XPS 문서 인쇄. 다른 dpi 설정시 다른 이미지 크기

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; 
    } 

난 = 120 montor dpi로있을 때보다 더 큰 (인쇄 후 용지)에 인쇄 된 페이지 모니터 dpi의 = 96 다음 이미지 크기를 가질 때 . 다른 크기의 이미지를 같은 크기로 인쇄하는 방법은 무엇입니까? 내가

image.Stretch = Stretch.Fill; 

이미지

image.Stretch = Stretch.None; 

을 대체

답변

0

올바른 인쇄 시작