[Cuis-dev] scaling an ImageMorph
Mark Volkmann
r.mark.volkmann at gmail.com
Fri Mar 21 18:27:59 PDT 2025
I want to render an image at some percentage less than 100% of its default
size.
I'm not trying to get an image to fill the extent of another morph.
This code, evaluated in a Workspace, renders an image at its full size.
What should I change to render it at 50% of that size?
filePath := '/Users/volkmannm/Pictures/images/altitude1600.jpg'.
form := Form fromFileNamed: filePath.
morph := ImageMorph newWith: form.
SystemWindow new addMorph: morph; openInWorld.
On Fri, Mar 21, 2025 at 3:02 PM Ezequiel Birman via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:
> errata: “self“ should be “anImageMorph”. I.e.:
>
> anImageMorph image: (anImage magnifyTo: anImageMorph morphExtent)
>
>
> On Fri, 21 Mar 2025 at 19:48, Ezequiel Birman <ebirman77 at gmail.com> wrote:
>
>> I'm not sure what are you trying to do but I'll guess that if you're
>> trying to get the image fill the morphExtent, you cand send `image:` to the
>> imageMorph.
>> anImageMorph image: (anImage magnifyTo: self morphExtent)
>>
>> HTH,
>>
>> --
>> Eze
>>
>> On Thu, 20 Mar 2025 at 09:00, Hilaire Fernandes via Cuis-dev <
>> cuis-dev at lists.cuis.st> wrote:
>>
>>> A remark, you should only magnify the form. Not sure it solves your
>>> problem, though
>>> Le 19/03/2025 à 22:11, Mark Volkmann via Cuis-dev a écrit :
>>>
>>> percent := 0.75.
>>> form := Form fromFileNamed: filePath :: magnifyBy: percent.
>>> morph := ImageMorph newWith: form :: scaleBy: percent.
>>>
>>> -- http://mamot.fr/@drgeo
>>>
>>> --
>>> 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/20250321/ff8fc02c/attachment.htm>
More information about the Cuis-dev
mailing list