<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 3/19/2025 6:11 PM, Mark Volkmann via Cuis-dev wrote:
<blockquote
cite="mid:CAFfRWnVD6s=EgXmV5KFQWBOZ8QTYFnn_U6T4NOXkPQRaf+TtEw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>What is the proper way (minimum code) to scale an
ImageMorph?</div>
<div>Do I have to scale both the form into which the image file
is loaded AND the ImageMorph like this?</div>
<div><br>
</div>
<div>filePath :=
'/Users/volkmannm/Pictures/images/altitude1600.jpg'.<br>
percent := 0.75.<br>
form := Form fromFileNamed: filePath :: magnifyBy: percent.<br>
morph := ImageMorph newWith: form :: scaleBy: percent.<br>
</div>
<div><br>
</div>
<div>When I add this morph to a SystemWindow, the image is
scaled, but there is an orange rectangle of the original size
behind the image. See the attached screenshot.</div>
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size: 12.8px;"><font
face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Just scale the form prior to using it: `(ImageMorph newWith:
(ImageMorph defaultForm magnifyBy: 0.5)) openInWorld.`<br>
<br>
A new kind of morph that is not part of the BoxMorph hierarchy would
give better flexibility, by not using an `extent` instance variable.
But may be the simplest solution works for you.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>