A Graphics Guru Challenge...

Dan Ingalls Dan at SqueakLand.org
Thu Jun 7 02:15:07 UTC 2001

>    This post is for the graphics guys here in SqueakVille. I have a small
>problem regarding WarpBlt. Can anyone think of a way to draw a source
>rectangle from one Form, onto an arbitrary quadrangle of another? This has
>been asked before, and i remember a few suggestions, yet none of them really
>solved it.

Hi, Ali -

Yes, you can do this... within reason.

First, the transformation from a quadrangle to a rectangle is an affine transformation.  Once you know this, you can compute the affine transformation you desire, apply its inverse to the destination rectangle that WarpBlt requires, and you will then have the quadrilateral that you need to use on the source.

Ted Kaehler wrote an affine transformation for exactly this reason shortly after I wrote WarpBlt, and I think it bounced around this list for a while.  In my opinion, we should put it in the release with a simple example, just to save the periodic discussion.

Anyway, I attach here the only relevant file I could find on my disk, but it should get you most of the way there, since it ends with a method called...
	<WarpBlt> copyRect: sourceRect toQuad: destQuad
Someone else may have a more polished take on this.

Enjoy, and we'll work on putting this into the system.

	- Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: AffineStuff-tk.cs.gz
Type: application/mac-binhex40
Size: 1799 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010606/489f4bef/AffineStuff-tk.cs.hqx

More information about the Squeak-dev mailing list