[Newbies] Resizing a form to specific width and height
matthias.korn at uni-siegen.de
Mon Jan 12 21:24:54 UTC 2009
thanks for your hint.
I tried WarpBlt class>>rotate:degrees:center:scaleBy:smoothing: and it
worked as expected. But I also found that I just had a slight mistake
and my initial try with Form>>magnifyBy: and aPoint (with x and y
scaling) was actually also successful. I am using this now.
P.S.: I had to fix Form>>magnifyBy: in my Squeak version as it
initially did not work with Points as advertised.
Am Mon, 12 Jan 2009 11:45:43 +0100
schrieb Bert Freudenberg <bert at freudenbergs.de>:
> On 12.01.2009, at 00:16, Matthias Korn wrote:
> > Hi,
> > how can I resize a form to a specific width and height by either
> > stretching it on one axis or cropping it on the other axis.
> Forms are fixed-size. The way you do it is by creating a new form of
> the desired extent and depth, and then copying (a part of) the old
> form into the new form, possibly scaling the pixels while doing so.
> This is done by class BitBlt (for "bit block transfer") and its
> extension WarpBlt (which can do scaling and rotation too).
> There are convenience methods hiding the details of form creation,
> BitBlt, and WarpBlt in class Form. E.g. "copy: aRectangle" does
> cropping, and "magnify: aRectangle by: aPoint smoothing: anInteger"
> does cropping and scaling.
> BitBlt also does bit-depth conversion, color-remapping, statistics,
> and other image manipulations. It's well worth learning about :)
> - Bert -
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
Institut für Wirtschaftsinformatik
Telefon: +49 (0) 271 / 23 67 660
Mobil: +49 (0) 176 / 700 17 17 8
Uni: +49 (0) 271/ 740 - 3382
eMail: matthias.korn at uni-siegen.de
More information about the Beginners