home *** CD-ROM | disk | FTP | other *** search
- Path: ifi.uio.no!usenet
- From: larshau@holmenkollen.ifi.uio.no (Lars Haugseth)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Scaling
- Date: 22 Feb 1996 20:45:13 +0100
- Organization: Dept. of Informatics, University of Oslo, Norway
- Message-ID: <y9f91hvm9fa.fsf@holmenkollen.ifi.uio.no>
- References: <1588.6626T1061T1294@sn.no>
- NNTP-Posting-Host: holmenkollen.ifi.uio.no
- In-reply-to: christon@sn.no's message of 22 Feb 1996 17:41:21 +0100
- X-Newsreader: Gnus v5.1
-
-
- [ Christopher Naas ]
-
- After having had a look at the BitMapScale (); routine, I'm a bit
- confused.
- bitscale->bsa_XDestFactor and bitscale->bsa_YDestFactor are
- defined as UWORD's. If I'm thinking correctly, then that means that you can
- only scale *up*, and only in powers of 2, i.e. 320->640 and so
- on. ??
-
- My question is then; am I wrong? (Hope so), and if so, how do I
- scale *down*, and how do I define a scaling from i.e. 13x13 to
- 15x15 and the other way around, from 15x15 to 13x13?
-
- Yes, you are wrong, luckily. :-)
- You can scale both up and down, and by any factor.
-
- These are the fields you need to set:
-
- bitscale->bsa_SrcX = 0;
- bitscale->bsa_SrcY = 0;
- bitscale->bsa_SrcWidth = src_width;
- bitscale->bsa_SrcHeight = src_height
- bitscale->bsa_DestX = 0;
- bitscale->bsa_DestY = 0;
- bitscale->bsa_XSrcFactor = src_width;
- bitscale->bsa_YSrcFactor = src_height;
- bitscale->bsa_XDestFactor = dst_width;
- bitscale->bsa_YDestFactor = dst_height;
- bitscale->bsa_SrcBitMap = src_bitmap;
- bitscale->bsa_DestBitMap = dst_bitmap;
- bitscale->bsa_Flags = 0;
-
- You don't need to set bsa_DestWidth or bsa_DestHeight, since they
- are only written to by the function, and never read.
-
- --
- Lars Haugseth
-
- --
- Lars Haugseth <larshau@ifi.uio.no>
-
-