<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 10/1/2024 8:04 PM, Mark Volkmann via Cuis-dev wrote:
    <blockquote
cite="mid:CAFfRWnWAV=HunTdcwFaGAWQLVV48_NwTDJTzENSru5TK9sPUmg@mail.gmail.com"
      type="cite">
      <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>
    </blockquote>
    <br>
    Yes!<br>
    <br>
    Cheers,<br>
    <br>
    <blockquote
cite="mid:CAFfRWnWAV=HunTdcwFaGAWQLVV48_NwTDJTzENSru5TK9sPUmg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <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 moz-do-not-send="true"
            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: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <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 moz-do-not-send="true" href="http://cuis.st" target="_blank">cuis.st</a>
<a moz-do-not-send="true" href="http://github.com/jvuletich" target="_blank">github.com/jvuletich</a>
<a moz-do-not-send="true" href="http://researchgate.net/profile/Juan-Vuletich" target="_blank">researchgate.net/profile/Juan-Vuletich</a>
<a moz-do-not-send="true" href="http://independent.academia.edu/JuanVuletich" target="_blank">independent.academia.edu/JuanVuletich</a>
<a moz-do-not-send="true" href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/juan-vuletich-75611b3" target="_blank">linkedin.com/in/juan-vuletich-75611b3</a>
<a moz-do-not-send="true" 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>
    </blockquote>
    <br>
    <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>