Application development - import image and mark it up with vector graphics and create PDF
Hi, What is involved in creating an application in Pharo, part of would which do the following: 1) Copy an image (ex: jpg) into a a window area. 2) Allow the user to add basic shapes on top of the image - square, circle, with text inside the shape. 3) Save this and generate a PDF. There is business domain logic surrounding this. Regards, Reg
Hi reg
Hi,
What is involved in creating an application in Pharo, part of would which do the following: 1) Copy an image (ex: jpg) into a a window area. simple: I do not have the time to look for such snippet but it should be two lines.
2) Allow the user to add basic shapes on top of the image - square, circle, with text inside the shape.
If you want to do that in vector graphics you should use Athens (I'm finishing a chapter but it is really draft) You should have a look at the Athens tutorial that you can find in the Athens repository. You will probably need to port the drawing methods of star and other basic morph if you want to use them with Athens.
3) Save this and generate a PDF. Have a look at the Artefact library because you can generate PDF.
There is business domain logic surrounding this.
Excellent. Let us know how we can help.
Regards,
Reg
We have been using Artefact for the Pdf production. Impressive library! It does not support rotate text however :-) Cheers, Alexandre On May 8, 2014, at 9:00 AM, Reg Krock <rkrock3@yahoo.ca> wrote:
Hi,
What is involved in creating an application in Pharo, part of would which do the following: 1) Copy an image (ex: jpg) into a a window area. 2) Allow the user to add basic shapes on top of the image - square, circle, with text inside the shape. 3) Save this and generate a PDF.
There is business domain logic surrounding this.
Regards,
Reg
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Dear Reg, Roassal may help you on this. Consider the following Roassal script: -=-=-=-=-=-=-=-=-=-=-=-= | v circle1 circle2 edge | "we define the view" v := RTView new. âTwo circles" circle1 := ((RTEllipse new size: 50) + (RTLabel new text: '1')) element. circle2 := ((RTEllipse new size: 50) + (RTLabel new text: '2')) element. âMake the circles draggable" circle1 @ RTDraggable. circle2 @ RTDraggable. âDefining an edge between the two circles" edge := (RTLine new width: 10) edgeFrom: circle1 to: circle2. circle2 translateTo: 60 @ 80. v add: edge. v add: circle1. v add: circle2. v open. "We export the whole thing" RTPDFExporter new exportView: v. -=-=-=-=-=-=-=-=-=-=-=-= You can reproduce the script by loading Roassal2 and GraphET2 from smalltalkhub. Else you can directly jump on the Moose distribution for trying this out ( https://ci.inria.fr/moose/job/moose-5.0/lastSuccessfulBuild/artifact/moose-5... ). I have uploaded the result for you: https://dl.dropboxusercontent.com/u/31543901/TMP/foo.pdf We can manipulate images as well (e.g., https://www.facebook.com/ObjectProfile/posts/628687443884523 ) Let us know how it goes... Cheers, Alexandre On May 8, 2014, at 9:00 AM, Reg Krock <rkrock3@yahoo.ca> wrote:
Hi,
What is involved in creating an application in Pharo, part of would which do the following: 1) Copy an image (ex: jpg) into a a window area. 2) Allow the user to add basic shapes on top of the image - square, circle, with text inside the shape. 3) Save this and generate a PDF.
There is business domain logic surrounding this.
Regards,
Reg
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
participants (3)
-
Alexandre Bergel -
Reg Krock -
stepharo