<div dir="ltr">In the current code the WorldMorph drawOn: method sends<div><font face="monospace">aCanvas image: backgroundImage at: `0@0`<br></font></div><div>if <font face="monospace">backgroundImage</font> is set.</div><div>That can be set with code like the following:</div><div><br></div><div><font face="monospace">filePath := '/Users/volkmannm/Pictures/images/altitude1600.jpg'.<br>byteArray := (filePath asFileEntry readStream) binary contentsOfEntireFile.<br>self runningWorld backgroundImageData: byteArray.</font><br></div><div><br></div><div>The <font face="monospace">backgroundImageData:</font> method is defined in <font face="monospace">PasteUpMorph</font> which is the superclass of <font face="monospace">WorldMorph</font>.</div><div>That method sends <font face="monospace">#buildMagnifiedBackgroundImage</font> to <font face="monospace">self</font>.</div><div>That method contains this line:</div><div><br></div><div><font face="monospace">backgroundImage := image magnifyTo: extent.<br></font></div><div><br></div><div>That stretches the image to fit the size of the <font face="monospace">WorldMorph</font> which is the size of the whole window.</div><div>It does not maintain the aspect ratio of the image.</div><div><br></div><div>That seems fine for images that are patterns, but not for images that contain recognizable things like people, animals, buildings, cars, ...</div><div><br></div><div>I think it would be great to have three options for how a background image is used,</div><div>1) stretch as is done currently</div><div>2) change size to cover <font face="monospace">WorldMorph</font> without changing the aspect ratio (right or bottom of image could be cut off)</div><div>3) tile the image over the window</div><div><br></div><div>I have learned how to modify <font face="monospace">WorldMorph</font> and <font face="monospace">PasteUpMorph</font> to tile the image and the cover option wouldn't be difficult to implement.</div><div>If I were to submit a change set that modifies WorldMorph and PasteMorph to support all three options, would it be considered?</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 30, 2024 at 8:23 PM Juan Vuletich <<a href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>

  
    
    
  
  <div bgcolor="#ffffff">
    On 9/30/2024 8:21 PM, Mark Volkmann via Cuis-dev wrote:
    <blockquote type="cite">
      <div dir="ltr">I see the Squeak has the class BackgroundMorph that
        supports tiling an image over the World background, but that
        class is not in Cuis. Is there another way to tile an image over
        the World background that is in the base Cuis image?<br clear="all">
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="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>
    Yes. You need to create your own morph, and in its #drawOn: method
    do whatever you need. You can also modify WorldMorph so it tiles. Go
    Smalltalk go!<br>
    <br>
    Cheers,<br>
    <pre cols="72">-- 
Juan Vuletich
<a href="http://cuis.st" target="_blank">cuis.st</a>
<a href="http://github.com/jvuletich" target="_blank">github.com/jvuletich</a>
<a href="http://researchgate.net/profile/Juan-Vuletich" target="_blank">researchgate.net/profile/Juan-Vuletich</a>
<a href="http://independent.academia.edu/JuanVuletich" target="_blank">independent.academia.edu/JuanVuletich</a>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a>
<a href="http://linkedin.com/in/juan-vuletich-75611b3" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a>
<a href="http://twitter.com/JuanVuletich" target="_blank">twitter.com/JuanVuletich</a></pre>
  </div>

</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="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>