[Cuis-dev] change image in ImageMorph

Ezequiel Birman ebirman77 at gmail.com
Sat Jun 1 20:15:51 PDT 2024


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240602/1ae03902/attachment-0001.htm>


More information about the Cuis-dev mailing list