[Cuis-dev] scaling an ImageMorph
Mark Volkmann
r.mark.volkmann at gmail.com
Sun Mar 23 04:18:38 PDT 2025
@Ezequiel Birman <ebirman77 at gmail.com> Instead of sending #openInWorld to
the morph, try this:
SystemWindow new addMorph: morph; openInWorld
You'll see the problem with the big orange area I'm trying to fix. The
orange comes from the defaultColor method of BorderedBoxMorph which is the
superclass of ImageMorph.
I feel like all that should be required is:
morph scaleBy: somePercentage
and it should render without the orange area. Maybe there's a change that
can be made to achieve that.
On Sat, Mar 22, 2025 at 11:50 AM Ezequiel Birman via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:
> Missed one line:
>
> filePath := '/Users/volkmannm/Pictures/images/altitude1600.jpg'.
>>
> form := Form fromFileNamed: filePath.
>>
> morph := ImageMorph newWith: form.
>>
> (morph scaleBy: 0.5; embeddedInMorphicWindowLabeled: 'test') openInWorld
>
>
> --
> Eze
>
> On Sat, 22 Mar 2025 at 16:42, Ezequiel Birman <ebirman77 at gmail.com> wrote:
>
>> Ah! I'd write something like:
>>
>>> filePath := '/Users/volkmannm/Pictures/images/altitude1600.jpg'.
>>
>> form := Form fromFileNamed: filePath.
>>>
>> (morph scaleBy: 0.5; embeddedInMorphicWindowLabeled: 'test') openInWorld
>>
>>
>> On Sat, 22 Mar 2025 at 01:28, Mark Volkmann <r.mark.volkmann at gmail.com>
>> wrote:
>>
>>> 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.
>>>
>> --
> 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/20250323/0ea71de3/attachment.htm>
More information about the Cuis-dev
mailing list