简体   繁体   中英

Set size and location of image in printpreview c#

i already can print a image into the printpreview, but when i click print preview, the image was too big. How do i resize it in printpreview? Here is the screenshot and also the code:

Here is the code:

e.Graphics.DrawImage(pb1.Image, 0, 0);

i put that code in printpreview function. So when i click printpreview, this function will run. And here is the result:

Here is the screenshot of the printpreview:

在此处输入图片说明

how do i resize it? the image was too big

您不仅可以指向图像的位置,还可以通过定义可以定义宽度/高度的矩形来指示图形将图像打印到特定区域。

e.Graphics.DrawImage(pb1.Image, new Rectangle(0, 0, width, height));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM