Editable Image Region - Сообщения
Alex, I'm curious, why not just take a screen shot of whatever you have on inkscape and then paste it into the calc book. That's what I do, crude, I know.
Another side question -> You state that you have never coded, what did you use to learn how to create plugins in SMath, maybe I have not looked into this enough. Is there a simple example somewhere?
Sorry for sidetracking here.
Thanks.
My 4th revision of the plugin.
On region cloning (ctrl is pressed) region is duplicated with new filename
On region copy / paste region is copied however filename does not have an extension (have no clue why, code is attached if you decide to dig around). Fix - right click and select desired extension
SVG does scale, however not in a way I would like it to (like a raster image)
If you have time please test - must catch bugs before sending it to repository
ImageRegion.004.zip (290 КиБ) скачан 74 раз(а).
Major deficiency - on re-opening the workbook file names loose its extensions. I'm sure its set to happen so in the code - I just need to find where/how does the region store its filename.
Also will likely have to leave svg non scalable for now - raster scaling is just plain wrong.
WroteHi All,
My 4th revision of the plugin.
On region cloning (ctrl is pressed) region is duplicated with new filename
On region copy / paste region is copied however filename does not have an extension (have no clue why, code is attached if you decide to dig around). Fix - right click and select desired extension
SVG does scale, however not in a way I would like it to (like a raster image)
If you have time please test - must catch bugs before sending it to repository
ImageRegion.004.zip (290 КиБ) скачан 74 раз(а).
Thanks again for the update.
- when the region is emty, the border does not indicate on/off state (yet the setting seems to be stored, image content seems to be required for the border to show up correctly
- Image boundaries in the region and in inkscape don't match. There is spurious whitespace to the right.
To me, it is limited to digitising a clean "something".
Exemplified in [Samples, Digitise].
If "something" is not monotonous => headache
1. READ_RED does not read "Unique red"
2. Red_blue_black Smath quickplot
==> READRGB ==> reads: green, unknown, red
3. An all colors image [Etoile] ==> READRGB
seems to plot R,G,B but don't know because of [2.]
Jean
Digitize Puzzle.sm (85 КиБ) скачан 60 раз(а).
1. READ_IMAGE reads grayscale RGB augmented, fine. Can extract each R,G,B, fine
A small 100x100 is huge in Smath, no problem to transit/collapse.
Why you must transit/collapse: because
because either R,G,B that you have assigned a variable name CAN NOT support
any matrix operation [ typical: scale(M,127,255]
CAN NOT support matrix operation 0K ! but it does crash the PC, crash dead:
no start/stop access, can't close any other application, can't stop calculation.
2. From the grayscale READ_IMAGE the R,G,B don't summ NTSC
0.2989*red+0.5870*green+0.1140*blue don't equate READ_IMAGE.
Jean
1. On region copy / paste region is copied however filename does not have an extension & on re-opening the workbook file names loose its extensions. - FIXED
2. Now copy / paste generates region with same name, while ctrl drag generates region with new name
3. Image boundaries in the region and in inkscape don't match. There is spurious whitespace to the right. - FIXED
4. Newly created .svg file now scales correctly after being edited in inkscape.
5. when the region is empty, the border does not indicate on/off state (yet the setting seems to be stored, image content seems to be required for the border to show up correctly - Cannot Reproduce, pls attach .sm workbook and explain what is wrong.
Side note - Martin, should I create a separate thread so this thread does not fill up with my frequent build updates?
ImageRegion.005.zip (271 КиБ) скачан 66 раз(а).
WrotePlugin build updates:
1. On region copy / paste region is copied however filename does not have an extension & on re-opening the workbook file names loose its extensions. - FIXED
2. Now copy / paste generates region with same name, while ctrl drag generates region with new name
3. Image boundaries in the region and in inkscape don't match. There is spurious whitespace to the right. - FIXED
4. Newly created .svg file now scales correctly after being edited in inkscape.
5. when the region is empty, the border does not indicate on/off state (yet the setting seems to be stored, image content seems to be required for the border to show up correctly - Cannot Reproduce, pls attach .sm workbook and explain what is wrong.
Side note - Martin, should I create a separate thread so this thread does not fill up with my frequent build updates?
ImageRegion.005.zip (271 КиБ) скачан 66 раз(а).
Thank for the update, Alex. I will test this tomorrow (2 am now here). This thread is perfect for image region development. You are definitly not the off-topic poster in this thread ;-)
You could, of course, open a new thread and use the initial post as a repository as long as you don't want to use the extension manager.
1. On region copy / paste region is copied however filename does not have an extension
==> If I open an *.svg in image region, I can add more stuff and save as "Export",
==> it automatically saves as *.svg ... where I want and named ame or different.
2. Now copy / paste generates region with same name, while ctrl drag generates region with new name.
==> ± same as opening a work sheet that has imported images, if the work sheet is Calc/OFF,
pressing F9 asks if I want to save on new name, if I say NO, bingo ==> opens the import.
5. when the region is empty, the border does not indicate on/off state
==> Empty or filled region has border ON/OFF
"Editable region(s)" is perfect to me. It goes nicely with "Formated Label", "Modeler"
BTW: the Modeler scale 0|__________|100 is 100 pixels ... looks in limbo ?
I used to have "pixel scales" vertical horizontal graduated at will from other applications
that have been recycled long time ago.
The Modeler exports as *.dxf [Autocad], No idea what it's for except to open some Smath
project with live maths in AutoCad [most probably dead maths]. Still interesting.
Jean
1. It switches OFF the grid lines [very useful otherwise].
2. It frezes acces to the embedded stuff.
3. Quick plot and other results are live in the region.
Interesting ? ... maybe not so much.
Jean
De Casteljau Minaret.sm (38 КиБ) скачан 61 раз(а).
So I need some ideas on how to speed up resizing of .SVG containing Image Region.
Currently this is what happens:
- you drag the regions size marker
- with every increment, the .svg image inside renders itself into raster image for display inside SMath workbook.
As you can guess that takes up alot of compute power and is slow.
Feel free to throw in conceptual suggestions I can use to speed things up
WroteInteresting Thread.
Alex, I'm curious, why not just take a screen shot of whatever you have on inkscape and then paste it into the calc book. That's what I do, crude, I know.
Another side question -> You state that you have never coded, what did you use to learn how to create plugins in SMath, maybe I have not looked into this enough. Is there a simple example somewhere?
Sorry for sidetracking here.
Thanks.
Ryan, I have summarized my journey through plugin development here:
http://en.smath.info/forum/yaf_postsm30280_SMath-Plugin-Tutorial---Need-Help-Please.aspx#post30280
Conviniently that is also the thread where I started the development. Good luck!
Also blank .svg you can insert into image region from context menu works as intended now (if you use .dll from last archive) ;-)
And why did I spend 6 hours of my time so far on this? I would like easily editable sketches in my calcbooks - modifying vector graphics is much easier than layerless raster image.
MathcadFileAccess. Image pack.sm (12 КиБ) скачан 74 раз(а).
Mathcad File Access. Image Pack.pdf (25 КиБ) скачан 81 раз(а).
Wrote
5. when the region is empty, the border does not indicate on/off state (yet the setting seems to be stored, image content seems to be required for the border to show up correctly - Cannot Reproduce, pls attach .sm workbook and explain what is wrong.
1. Insert> Image
2. try to switch off the image border in the context menu.
this does not work for me, the border is still displayed.
3. If you then create an image (set the format, doubleclick to edit), then the border is removed.
Seems that switching the border state works with an empty region, just the display does not obey the setting.
Another problem:
If I open the image in the attached sm file, then some objects are invisible in inkscape. They all were created with inkscape. The reference points of the 3D projection seem to get lost or modified. Could that be a side effect of the size handling?
svg2.sm (28 КиБ) скачан 82 раз(а).
What is the intent of the different behaviour between cloning and copy/paste? Usually, there is no difference, cloning (ctrl-drag) is just a gui shortcut.
I guess that most users would be surprised by the invisible link between the original and the copy. I'd vote for copy/past behaving just like cloning (same image contents but separate file)svg2.sm (28 КиБ) скачан 82 раз(а).
If multiple instances of the same image are required, then still there is the option to have this as external file (export the file and put the name in the placeholder).
WroteWhat is the intent of the different behaviour between cloning and copy/paste? Usually, there is no difference, cloning (ctrl-drag) is just a gui shortcut.
Copy + Paste are 2 actions to copy data to/from the system clipboard (as principle you can share the data with any other compatible third-party program or any other instance of the same application). Ctrl+Drag is an action to clone an object inside the current instance of the application. The final result may appears to be the same (provided you paste what you've copied) but the process and what you can do is different.
In SMath:
- copy/paste is performed serializing and deserializing the data via ToXml/FromXml. Since the data is passed by parsing values contained in the xml string taken from the clipboard, new objects are not linked to the original.
- Ctrl+Drag is driven by Clone(). Here you have to deal with .NET Framework; some types are passed by reference, other by values (see here and here). Depending on how it is developed the region, you may need that some values passed by reference were passed by values; in this case you have to make a deep copy of the objects, implementing your own Clone() in your classes to break the references.
WroteWroteWhat is the intent of the different behaviour between cloning and copy/paste? Usually, there is no difference, cloning (ctrl-drag) is just a gui shortcut.
Copy + Paste are 2 actions to copy data to/from the system clipboard (as principle you can share the data with any other compatible third-party program or any other instance of the same application). Ctrl+Drag is an action to clone an object inside the current instance of the application. The final result may appears to be the same (provided you paste what you've copied) but the process and what you can do is different.
In SMath:
- copy/paste is performed serializing and deserializing the data via ToXml/FromXml. Since the data is passed by parsing values contained in the xml string taken from the clipboard, new objects are not linked to the original.
- Ctrl+Drag is driven by Clone(). Here you have to deal with .NET Framework; some types are passed by reference, other by values (see here and here). Depending on how it is developed the region, you may need that some values passed by reference were passed by values; in this case you have to make a deep copy of the objects, implementing your own Clone() in your classes to break the references.
I understand that Ctrl-drag and Copy/paste CAN do different things. But if you clone text or math regions, then these are independent (if you change one, then the other is not affected. I guess this is what a user would expect also for other regions and their contents. I just see the danger of unintended overwriting of clone sources by editing the dependent instances. This has happened once in a while to me.
WroteI understand that Ctrl-drag and Copy/paste CAN do different things. But if you clone text or math regions, then these are independent (if you change one, then the other is not affected).
I agree

Just tried to clarify why you may notice 2 different behaviors. Since are 2 different things, one may be buggy indipendently from the other.
1. "Inkscape" current save formats are (at least): Inkscape SVG(Z), Plain SVG(Z), PS, EPS, Cairo PDF, Cairo PS, POV, ODG, TEX, AI (8.0), DXF, AutoCAD DXF, EPSI, GPL, XCF, XAML, Inkscape svg with media ZIP, EMF. [Wiki Info].
==> does not save as *.bmp, *.png ==> therefore not compatible with Smath File Access.
==> Argument closed
2. Smath Image Region does NOT zoom. It spreads the tartine ==> therefore useless.
3. Smath does not transport the Red from QuickPlot. Maybe vice versa: does not read red from QuickPlot.
4. Smath region in native project is a matrix grayscale viewer. NOT a picture operator.
Suggestions:
1. Capture screen via WinGrab [rich in color reduction]
2. Zoom via IrfanView [aspect ratio = or not equal, rich Lanczos zoom].
** IrfanView, WinGrab ==> freeware
Jean
Work sheet named easy to retrieve in the context.
Image Martin svg2.sm (206 КиБ) скачан 59 раз(а).
WroteComments:
1. "Inkscape" current save formats are (at least): Inkscape SVG(Z), Plain SVG(Z), PS, EPS, Cairo PDF, Cairo PS, POV, ODG, TEX, AI (8.0), DXF, AutoCAD DXF, EPSI, GPL, XCF, XAML, Inkscape svg with media ZIP, EMF. [Wiki Info].
==> does not save as *.bmp, *.png ==> therefore not compatible with Smath File Access.
==> Argument closed
2. Smath Image Region does NOT zoom. It spreads the tartine ==> therefore useless.
3. Smath does not transport the Red from QuickPlot. Maybe vice versa: does not read red from QuickPlot.
4. Smath region in native project is a matrix grayscale viewer. NOT a picture operator.
Suggestions:
1. Capture screen via WinGrab [rich in color reduction]
2. Zoom via IrfanView [aspect ratio = or not equal, rich Lanczos zoom].
** IrfanView, WinGrab ==> freeware
Jean
Work sheet named easy to retrieve in the context.
1. Wiki is not a reliable source of information. As your statement proves. You actually can export png.
2. You are probably referring to the Picture Region, not the Image Region.
If the sheets you post refer to external files, please make sure to use relative paths, set the current directory to the document directory and include the files in the post. Except you want to demonstrate what happens if file access fails ;-)
I have done this - found no file found error annoying as well after some use (new .dll is not included yet).
<1. Insert Image
2. try to switch off the image border in the context menu.
this does not work for me, the border is still displayed.>
Unless I am wrong, this is how original image region behaved (I just redownloaded it), do we want to change that?
I am at the stand still here. The plugin only zooms SVG files if no height/width is present inside the file, or if it is set to % (as I did for blank svg). For either of those cases, when inkscape re-opens the svg, the "3D Box" objects were minimized to the bottom left corner (you still can scale them up if desired). If someone can come up with .svg file that both scales in SMath, and is saved/opened correctly by inkscpe I can use it as a blank document in the plugin. It is not a big deal for me though - how often will you sketch those 3D boxes in SMath?
This one is tricky. While there is no intent, per say, I am not sure how to change it either. You see, I can define Clone () though the code, while copy/paste just takes the region and creates the exact duplicate (just like Davide mentioned). And while you can edit the formula you copy/pasted, you cannot redefine the filename of the image in the region from SMath. Davide, do you think there is a conceptual way to change the name of the imbedded image during copy / paste? I cannot think of one..
Will try :-) update / resize functions are used throughout the code and it will take some effort to seprate the two (i.e. resize without re-rendering of svg, unless certain condition). It should be possible, the question is whether I will be succesful at it.
Also I am getting close to the point where I wanted to be for the Image Region development (once I take care of the above, if it proves to be possible / necessary). Do you guys have any major griefs with it, or suggestions? Otherwise I wil wrap it up and publish to the extensions manager.
WroteHi All, I probably wont get to work on the image region till weekend, however it is a good idea to think of a roadmap. Martin, to discuss your comments:
I have done this - found no file found error annoying as well after some use (new .dll is not included yet).
Great.
Цитата
<1. Insert Image
2. try to switch off the image border in the context menu.
this does not work for me, the border is still displayed.>
Unless I am wrong, this is how original image region behaved (I just redownloaded it), do we want to change that?
Switching off the border of an empty region would imply the danger of having an invisible region. On the other hand, offering to switch off the border and not to reflect the change is inconsistent user experience. One solution would be to grey out the border switch as long as the region is empty (if it is just filled with a white image, that would do as well. Then the region is visible if you have the grid on.
Цитата
I am at the stand still here. The plugin only zooms SVG files if no height/width is present inside the file, or if it is set to % (as I did for blank svg). For either of those cases, when inkscape re-opens the svg, the "3D Box" objects were minimized to the bottom left corner (you still can scale them up if desired). If someone can come up with .svg file that both scales in SMath, and is saved/opened correctly by inkscpe I can use it as a blank document in the plugin. It is not a big deal for me though - how often will you sketch those 3D boxes in SMath?
I don't care the 3D objects. Yet this is a limitation which should be mentioned in the doc and kept in the bug list.
Цитата
This one is tricky. While there is no intent, per say, I am not sure how to change it either. You see, I can define Clone () though the code, while copy/paste just takes the region and creates the exact duplicate (just like Davide mentioned). And while you can edit the formula you copy/pasted, you cannot redefine the filename of the image in the region from SMath. Davide, do you think there is a conceptual way to change the name of the imbedded image during copy / paste? I cannot think of one..
I am happy with Ctrl-Drag. However, it will be hard to explain that to new users (I give a getting started course to my students every year).
Цитата
Will try :-) update / resize functions are used throughout the code and it will take some effort to seprate the two (i.e. resize without re-rendering of svg, unless certain condition). It should be possible, the question is whether I will be succesful at it.
It is acceptable. Anyways, most people will use the region for quick and dirty illustrations of moderate complexity. I generally vote for doing the annotations with overlaid math regions. This keeps the sketches simple and the annotations consistent with the worksheet.
Цитата
Also I am getting close to the point where I wanted to be for the Image Region development (once I take care of the above, if it proves to be possible / necessary). Do you guys have any major griefs with it, or suggestions? Otherwise I wil wrap it up and publish to the extensions manager.
Looking forward to your upload. Maybe, it's triggering a new unofficial portable version, including an update of the help page for the image region.
-
Новые сообщения
-
Нет новых сообщений