[ENH] EdgeImageMorph

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Thu Dec 16 21:09:40 UTC 1999


--747459867-1810787224-945378580=:21701
Content-Type: TEXT/PLAIN; charset=US-ASCII


This is the first by-product of my upcoming "Fur for Squeak" widget
themes. There, it will be a replacement for the ubiquitous RectangleMorph.
But I figured it might be fun to use for others, too. 

Just try "New Morph -> Fur -> EdgeImageMorph". Resize it. Enable
"colorize" in the halo menu and recolor it. And if you still don't see
what the fuzz is all about make that morph big and send it an
 "edgeWidth: 0" (that's how it would look like without the fuzz). Oh, you
should have a hicolor video mode at least ;-)

>From the class comment: 

I am a resizable recolorable edge-preserving image morph.

The image is devided into 3x3 sectors, and I warpBlt these sectors
appropriately. The four corner sectors ("corners") are not scaled at all. 
The left and right center sectors ("edges") are scaled vertically but not 
horizontally, and the top and bottom edges are scaled horizontally but
not vertically. The center, if visible, is scaled in both directions. So, 
if all edge widths are set to 0, I behave just like a scalable
ImageMorph. Or, if my top edge width is set to the image height (with
zero bottom edge width), I can only ever be stretched horizontally.

Recoloring me means overriding the images colors with my own background
color (see Color>>#colorizeWith:). A 0.5 gray value maps to my color
exactly, whereas darker/lighter grays darken/lighten my color. This is
only available when the image is a ColorForm.

Enjoy!

  -Bert-

--747459867-1810787224-945378580=:21701
Content-Type: text/plain; name="EdgeImage-bf.1.cs"
 ; x-mac-type="54455854"
 ; x-mac-creator="522A6368"
Content-Disposition: attachment; filename="EdgeImage-bf.1.cs"
Content-Transfer-Encoding: imap_stub

0,2433,2,22116,356,

--747459867-1810787224-945378580=:21701--





More information about the Squeak-dev mailing list