Editable Image Region

Editable Image Region - Messages

#101 Posted: 2/13/2016 3:03:18 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 users liked this post
Davide Carpi 2/13/2016 1:24:00 PM
#102 Posted: 2/13/2016 4:14:16 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

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

Pretty impressive

ImageTestFile.sm (2 MiB) downloaded 104 time(s).

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

https://drive.google.com/file/d/0Bw0qVm5PVpzvZzdEZEFpQXRicXM/view?usp=sharing
1 users liked this post
Davide Carpi 2/13/2016 7:52:00 AM
#103 Posted: 2/13/2016 1:23:17 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 Posted: 2/13/2016 1:52:45 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 Posted: 2/13/2016 2:22:16 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 users liked this post
Davide Carpi 2/13/2016 10:59:00 PM
#106 Posted: 2/13/2016 2:34:06 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 Posted: 2/13/2016 4:51:34 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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 Posted: 2/14/2016 3:32:30 AM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 users liked this post
Davide Carpi 2/14/2016 8:06:00 AM
#109 Posted: 2/12/2017 6:47:10 PM
overlord

overlord

554 likes in 1333 posts.

Group: 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 Posted: 2/20/2017 7:34:42 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: 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 Posted: 2/20/2017 10:43:03 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

2560x1440 resolution



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

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 93 time(s).
#113 Posted: 2/22/2017 7:15:02 PM
overlord

overlord

554 likes in 1333 posts.

Group: 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 KiB) downloaded 93 time(s).



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 Posted: 2/23/2017 2:30:52 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 2/23/2017 3:31:44 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: 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
  • New Posts New Posts
  • No New Posts No New Posts