How images can be loaded

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How images can be loaded

Ronie Salgado
Hello,

I would like to know how I could load .png image into pharo, and being able to access to their pixel data for manipulation or display it.

Greetings,
Ronie Salgado
Reply | Threaded
Open this post in threaded view
|

Re: How images can be loaded

Sven Van Caekenberghe-2
Hi Ronie,

On 22 Nov 2013, at 19:00, Ronie Salgado <[hidden email]> wrote:

> Hello,
>
> I would like to know how I could load .png image into pharo, and being able to access to their pixel data for manipulation or display it.
>
> Greetings,
> Ronie Salgado

Here is an example:

'/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in |
 (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

Inspect the results of #nextImage or #asMorph to learn more, this code actually opens the image in a window in Pharo.

Regards,

Sven
Reply | Threaded
Open this post in threaded view
|

Re: How images can be loaded

Ronie Salgado
Thanks, It works very well.

Greetings,
Ronie Salgado


2013/11/22 Sven Van Caekenberghe <[hidden email]>
Hi Ronie,

On 22 Nov 2013, at 19:00, Ronie Salgado <[hidden email]> wrote:

> Hello,
>
> I would like to know how I could load .png image into pharo, and being able to access to their pixel data for manipulation or display it.
>
> Greetings,
> Ronie Salgado

Here is an example:

'/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in |
 (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

Inspect the results of #nextImage or #asMorph to learn more, this code actually opens the image in a window in Pharo.

Regards,

Sven

Reply | Threaded
Open this post in threaded view
|

Re: How images can be loaded

Stéphane Ducasse
hi ronie

to get access to pixel have a look at the Form class (you also have the BitBlt class).
Once you have a Morph you can get its form normally sending it form.

Stef
On Nov 22, 2013, at 7:45 PM, Ronie Salgado <[hidden email]> wrote:

Thanks, It works very well.

Greetings,
Ronie Salgado


2013/11/22 Sven Van Caekenberghe <[hidden email]>
Hi Ronie,

On 22 Nov 2013, at 19:00, Ronie Salgado <[hidden email]> wrote:

> Hello,
>
> I would like to know how I could load .png image into pharo, and being able to access to their pixel data for manipulation or display it.
>
> Greetings,
> Ronie Salgado

Here is an example:

'/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in |
 (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

Inspect the results of #nextImage or #asMorph to learn more, this code actually opens the image in a window in Pharo.

Regards,

Sven


Reply | Threaded
Open this post in threaded view
|

Re: How images can be loaded

hilaire
In reply to this post by Ronie Salgado
CONTENTS DELETED
The author has deleted this message.