"Quick and easy way to get an image from a URL"
ZnEasy getPng: 'http://www.pharo.org/files/pharo.png'.
"Turn bytes into an image inside Pharo"
(PNGReadWriter on: 'http://www.pharo.org/files/pharo.png' asUrl
retrieveContents readStream) nextImage.
"Store image bytes as Base64 and recreate the ima
On Sat, May 16, 2015 at 5:28 PM, Merwan Ouddane
wrote:
> You can encore your image in base64
> anImage := 'holidays.png' asFileReference readStream binary.
> encodedImage := Base64MimeConverter mimeEncode: anImage.
>
>
> Then you can decode it with:
> ImageReadWriter formFromStream: (
You can encore your image in base64
anImage := 'holidays.png' asFileReference readStream binary.
encodedImage := Base64MimeConverter mimeEncode: anImage.
Then you can decode it with:
ImageReadWriter formFromStream: (Base64MimeConverter
mimeDecodeToBytes: encodedImage).
Is this what
You can also use this utility to simplify generation of the array.
http://smalltalkhub.com/#!/~peteruhnak/IconFactory
Peter
On Fri, May 15, 2015 at 9:37 PM, stepharo wrote:
> Look at the icons because they are managed like an encoded byte array.
>
>
> Le 15/5/15 21:11, Leonardo Silva a écrit :
Look at the icons because they are managed like an encoded byte array.
Le 15/5/15 21:11, Leonardo Silva a écrit :
Hi,
I load a PNG file using the code below:
pngPath := '/Users/Somefolder/UI-Theme.png' asFileReference.
forms := pngPath readStreamDo: [ :in | (PNGReadWriter on: in)
nextImage
Hi,
I load a PNG file using the code below:
pngPath := '/Users/Somefolder/UI-Theme.png' asFileReference.
forms := pngPath readStreamDo: [ :in | (PNGReadWriter on: in) nextImage ].
...
But I don't want to create this dependency with a file path.
I would like to be able to encode the image into a