Editable Image Region

Editable Image Region - 消息

#101 已发布: 2016/2/13 03:03:18
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Davide, I need your help.

I just realized that if I use "Open With..." on a new blank image (say png) and edit/save it, the changes are not visible and do not load till its double clicked. If you check the code there is not too much difference between the two, except simple "Open" command also calls base.OnMouseDown() which I cannot call from a menu item, can I).

If image region was double clicked prior to using "Open With..." it works OK.

Any thoughts how to fix this?

Fixed it... I forgot to set imageWasChanged = true in openAs()..
1位用户喜欢此帖子
Davide Carpi 2016/2/13 13:24:00
#102 已发布: 2016/2/13 04:14:16
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Here is a sample of what the new Image Region can do.

Pretty impressive

ImageTestFile.sm (2.09 MiB)已下载 1854 次。

Don't forget to use ALL the latest .dll's!

https://drive.google.com/file/d/0Bw0qVm5PVpzvZzdEZEFpQXRicXM/view?usp=sharing
1位用户喜欢此帖子
Davide Carpi 2016/2/13 07:52:00
#103 已发布: 2016/2/13 13:23:17
Davide Carpi

Davide Carpi

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

组: Moderator

Wrote

Fixed it... I forgot to set imageWasChanged = true in openAs()..



Good

Minor thing, not sure about the purpose of these 3 lines of code in the open with MenuButton, seems it works fine even without.

                    canvas.Invalidate();
                    canvas.PrePainter();
                    canvas.ReadyToPaint();
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#104 已发布: 2016/2/13 13:52:45
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Wrote


IPE can create pdf and has layers plus uses latex for embedded math stuff. Thus displaying pdf images might be an option. However, I don't know how many users would appreciate that. If I want to have a nice figure, I use IPE generated pdfs (currently just screenshots to transfer them to smath)



Martin could you educate me on the use of IPE? Can you set the .PDF page size? IPE does not seem to read any PDF unfortunately. Otherwise it is a great sketching tool! How come didn't I see it earlier..

It will be super quick to add support for IPE if I could generate a .pdf that IPE can read with pre-set page size (dimensions of the image region)

Thanks



#105 已发布: 2016/2/13 14:22:16
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

It is pretty impressive what you can achieve with matrix manipulations, Jean. Keep it up!

Wait my friend, you have not seen all what I can do with a shovel and a glass of cognac !
I hope Davide or more collabs will help in rotating by an angle.
Yourself: do you have idea to rescue rotate degree ?

Andrey: where are you these days ?

Cheers, Jean

1位用户喜欢此帖子
Davide Carpi 2016/2/13 22:59:00
#106 已发布: 2016/2/13 14:34:06
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Wrote

Wrote

Fixed it... I forgot to set imageWasChanged = true in openAs()..



Good

Minor thing, not sure about the purpose of these 3 lines of code in the open with MenuButton, seems it works fine even without.

                    canvas.Invalidate();
                    canvas.PrePainter();
                    canvas.ReadyToPaint();



No purpose - was messing around to see what would fix "Open With..." - frankly could use some explaining on what those functions do.
#107 已发布: 2016/2/13 16:51:34
Davide Carpi

Davide Carpi

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

组: Moderator

Wrote

frankly could use some explaining on what those functions do.



Let's say you want to change the size of the region (f.e. because you wanna keep the scale factor while you rotate the image or after the external editor changes the image size).

From the region holder you can call:


			// do something that requires a change of the size from inside the region (no resize markers involved)
			// ... 
			this.canv.SetSize(); // this changes the sizes of the canvas from the canvas, if the calculations are made in the canvas;
			// alternatively: this.canv.Size = new Size(newWidth, newHeight); // newWidth, newHeight calculated/available in the region holder
			this.PrePainter(); // this is needed to change the sizes and the positions of the region elements
			this.Invalidate(); // this repaints all

While the canvas' method SetSize() contains:

this.Size = new Size(newWidth,newHeight); // newWidth, newHeight calculated/available in the region canvas

If you don't use PrePainter, the math placeholder doesn't fit the new canvas size/position (as well as the selection rectangle and the region canvas itself)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#108 已发布: 2016/2/14 03:32:30
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Wrote

Wrote

frankly could use some explaining on what those functions do.



Let's say you want to change the size of the region (f.e. because you wanna keep the scale factor while you rotate the image or after the external editor changes the image size).

From the region holder you can call:


			// do something that requires a change of the size from inside the region (no resize markers involved)
			// ... 
			this.canv.SetSize(); // this changes the sizes of the canvas from the canvas, if the calculations are made in the canvas;
			// alternatively: this.canv.Size = new Size(newWidth, newHeight); // newWidth, newHeight calculated/available in the region holder
			this.PrePainter(); // this is needed to change the sizes and the positions of the region elements
			this.Invalidate(); // this repaints all

While the canvas' method SetSize() contains:

this.Size = new Size(newWidth,newHeight); // newWidth, newHeight calculated/available in the region canvas

If you don't use PrePainter, the math placeholder doesn't fit the new canvas size/position (as well as the selection rectangle and the region canvas itself)



Thank you for explanation, Davide. As always very informative!
1位用户喜欢此帖子
Davide Carpi 2016/2/14 08:06:00
#109 已发布: 2017/2/12 18:47:10
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

I don't know what is happening but it seems image plugin is ruining the integrity of Smath Studio
I am using Nvidia GTX 1070 with 2560x1440 resolution and 125% text on Windows 10 if it will helps.

Without Plugin everything seems normal,
without image plugin.png

When I install the plugin the Smath Studio got crazy.
with image plugin.png
#110 已发布: 2017/2/20 19:34:42
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

Wrote

I don't know what is happening but it seems image plugin is ruining the integrity of Smath Studio
I am using Nvidia GTX 1070 with 2560x1440 resolution and 125% text on Windows 10 if it will helps.



What is the version of SMath you are using?

debugging in WIN10 will be a challenge because I still use WIN7.

#111 已发布: 2017/2/20 22:43:03
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

2560x1440 resolution



That is not resolution, it is the "pixel display".
PC screen have 96 ppi resolution [ppi = pixel per inch]
#112 已发布: 2017/2/20 22:57:41
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

it seems image plugin is ruining the integrity of Smath Studio



If you get the last R,G,B,Yw,Cy,Ma => the image region is OK.
This is 6179 on Win 7 ... please report for further insight.

Jean

Image RGBYCM.sm (292.27 KiB)已下载 1729 次。
#113 已发布: 2017/2/22 19:15:02
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

Wrote

2560x1440 resolution



That is not resolution, it is the "pixel display".
PC screen have 96 ppi resolution [ppi = pixel per inch]



I know you just love to correct people but according to wikipedia your statement is wrong. 2560x1440 is a resoulution and called WQHD.

https://en.wikipedia.org/wiki/Graphics_display_resolution

Wrote

Wrote

it seems image plugin is ruining the integrity of Smath Studio



If you get the last R,G,B,Yw,Cy,Ma => the image region is OK.
This is 6179 on Win 7 ... please report for further insight.

Jean

Image RGBYCM.sm (292.27 KiB)已下载 1729 次。



I have never said image region is not working, it just scrambles the Smath (6179) window with my Windows 10 display settings.
You can see that on the screenshot below too. Everything is fine if I remove Image Region.
Regards

SC1.png

SC2.png

#114 已发布: 2017/2/23 14:30:52
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

"Resolution is the capability of the sensor to observe or measure the smallest object
clearly with distinct boundaries ..." fineness ... number of details per unit area ...

The human eye is normalised 1200 ppi. A photo sensor 1" square at 15 MegaPixels is
equivalent to human eye. To view the captured details you will have to display on
a PC 12.5" x 12.5" ... 1200/96 ~ 12.5

What needs be doctored in your red squares: Smath Win 10 ? your box ?
Can't help.
#115 已发布: 2017/2/23 15:31:44
Davide Carpi

Davide Carpi

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

组: Moderator

Issues are are form's fonts changed, desktop background visible through the window and these. I'll see if I can help Alex, as pointed out the issues are related to windows 10 only.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • 有新帖
  • 无新帖