Picture Region - source code

Picture Region - source code - 消息

#1 已发布: 2016/5/19 14:12:14
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Hello All,

I am investigating why, when plotted, Picture Region displays correctly, while Image Region is scaled down / up depending on the system DPI setting.

It would help to look at the source code of Picture Region. Any ideas where I can find it?

Thanks!
#2 已发布: 2016/5/19 19:52:00
Andrey Ivashov

Andrey Ivashov

2,344个赞,共4,057个帖子。

组: Super Administrator

Please check e-mail from me.

Regards.
#3 已发布: 2016/5/19 20:38:46
Davide Carpi

Davide Carpi

1,443个赞,共2,936个帖子。

组: Moderator

Welcome to the jungle

GDI+ (that we use to draw regions) is designed to render the things with the same size on all the devices (it means that if you take a ruler, same stuff in devices with different DPI should be rendered with the same size). Forms instead are drawn with GDI, and are scaled (see here); fonts in GDI+ are scaled too.

For what I cans see, both picture and image edit regions act in the same way, as well as the worksheet (unscaled).

In the article above, Microsoft says:
引用

If your application is DPI-aware and you use GDI for drawing, scale all of your drawing coordinates to match the DPI.


Alternatively the other choice should be to scale all the font-sizes to be device-indipendent as they are now the canvas and the regions...
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 已发布: 2016/5/21 18:29:23
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Actually with the help of Andrey's Picture Region it was fairly straight forward to get very high quality PDF prints (see attached).

I have an issue though. When I "reset to original size", the image does re-draw to original size, however the size of the region does not change...
ResetBug.png
(Note the shorter and wider rectangle - that is the region size prior to reset click)

Davide, Andrey, do you have any suggestions what might be happening here?

Thanks!

ImageTestFile.2.pdf (1.46 MiB)已下载 888 次。
ImageTestFile.sm (3.83 MiB)已下载 1368 次。
code
MyRev.zip (153.08 KiB)已下载 407 次。
  • 有新帖
  • 无新帖