[Cuis-dev] change image in ImageMorph

Mark Volkmann r.mark.volkmann at gmail.com
Sun Jun 2 07:40:33 PDT 2024


Thanks for the information about reading image files into ImageMorph! I
tried this:

ImageMorph new image: (Form fromFileNamed: 'squeak-smalltalk-logo.png');
openInWorld.

How can I discover the directory that looks in for the file by default?

On Sat, Jun 1, 2024 at 10:16 PM Ezequiel Birman via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> There is an example in ImageMorph's comment. You can also look at the
> implementation of ImageMorph >> readFromFile. It prompts for a file name
> and then does what you are asking for:
>
>> ... self image: (Form fromFileNamed: fileName)
>
>
> So the statement could be:
>
>> myImage := Form fromFileNamed:
>> '../Cuis/Learning-Cuis/CuisLiftsAboveItsWeight.png'
>
>
> See also
> *ImageReadWriter class >> imageMorphFromFileEntry:.*
>
> Happy hacking!
>
>
> On Sun, 2 Jun 2024 at 01:36, Mark Volkmann via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> I imagine that changing the image displayed in an `ImageMorph` requires
>> two statements, one to load an image from a file and one to change the
>> `ImageMorph`. I think the second one looks like this:
>>
>> `myImageMorph image: myImage.`
>>
>> What's the statement I need to set the variable `myImage` to an image
>> object?
>>
>> --
>> R. Mark Volkmann
>> Object Computing, Inc.
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240602/bab02c38/attachment-0001.htm>


More information about the Cuis-dev mailing list