Hi all, How can i make a morph display an image from a file at my hd? How can i further "save" this image inside a class so to be ported via packages? Thanks, Laura
Just look at FileReference>>gtInspectorPngIn: To see the effect, inspect the a .png file reference. Cheers, Doru On Sat, Jun 27, 2015 at 5:15 PM, Laura Risani <laura.risani@gmail.com> wrote:
Hi all, How can i make a morph display an image from a file at my hd? How can i further "save" this image inside a class so to be ported via packages? Thanks, Laura
-- www.tudorgirba.com "Every thing has its own flow"
As for the saving, you can also look at http://smalltalkhub.com/#!/~peteruhnak/IconFactory (or just browse ThemeIcons, which is already present in the image), which stores the images in methods as base64 strings. Peter On Sat, Jun 27, 2015 at 5:20 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Just look at FileReference>>gtInspectorPngIn:
To see the effect, inspect the a .png file reference.
Cheers, Doru
On Sat, Jun 27, 2015 at 5:15 PM, Laura Risani <laura.risani@gmail.com> wrote:
Hi all, How can i make a morph display an image from a file at my hd? How can i further "save" this image inside a class so to be ported via packages? Thanks, Laura
-- www.tudorgirba.com
"Every thing has its own flow"
Here are two examples that contain elements of what you want: (ZnEasy getPng: 'http://pharo.org/web/files/pharo.png') asMorph openInWindow. (FileLocator workingDirectory filesMatching: '*.jpg') do: [ :each | (each withExtension: 'png') writeStreamDo: [ :out | each readStreamDo: [ :in | (PNGReadWriter on: out) nextPutImage: (JPEGReadWriter on: in) nextImage ] ] ] Seaside has file library objects that store images and other resources as methods.
On 27 Jun 2015, at 17:15, Laura Risani <laura.risani@gmail.com> wrote:
Hi all, How can i make a morph display an image from a file at my hd? How can i further "save" this image inside a class so to be ported via packages? Thanks, Laura
Ok ! The snippet explained the reading from file, and ThemeIcons explained the saving-to/loading-from method. On Sat, Jun 27, 2015 at 2:20 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Here are two examples that contain elements of what you want:
(ZnEasy getPng: 'http://pharo.org/web/files/pharo.png') asMorph openInWindow.
(FileLocator workingDirectory filesMatching: '*.jpg') do: [ :each | (each withExtension: 'png') writeStreamDo: [ :out | each readStreamDo: [ :in | (PNGReadWriter on: out) nextPutImage: (JPEGReadWriter on: in) nextImage ] ] ]
Seaside has file library objects that store images and other resources as methods.
On 27 Jun 2015, at 17:15, Laura Risani <laura.risani@gmail.com> wrote:
Hi all, How can i make a morph display an image from a file at my hd? How can i further "save" this image inside a class so to be ported via packages? Thanks, Laura
participants (4)
-
Laura Risani -
Peter Uhnák -
Sven Van Caekenberghe -
Tudor Girba