home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3638 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: ifi.uio.no!usenet
  2. From: larshau@holmenkollen.ifi.uio.no (Lars Haugseth)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Scaling
  5. Date: 22 Feb 1996 20:45:13 +0100
  6. Organization: Dept. of Informatics, University of Oslo, Norway
  7. Message-ID: <y9f91hvm9fa.fsf@holmenkollen.ifi.uio.no>
  8. References: <1588.6626T1061T1294@sn.no>
  9. NNTP-Posting-Host: holmenkollen.ifi.uio.no
  10. In-reply-to: christon@sn.no's message of 22 Feb 1996 17:41:21 +0100
  11. X-Newsreader: Gnus v5.1
  12.  
  13.  
  14.  [ Christopher Naas ]
  15.  
  16.    After having had a look at the BitMapScale (); routine, I'm a bit
  17.    confused.
  18.    bitscale->bsa_XDestFactor and bitscale->bsa_YDestFactor are
  19.    defined as UWORD's. If I'm thinking correctly, then that means that you can
  20.    only scale *up*, and only in powers of 2, i.e. 320->640 and so
  21.    on. ??
  22.  
  23.    My question is then; am I wrong? (Hope so), and if so, how do I
  24.    scale *down*, and how do I define a scaling from i.e. 13x13 to
  25.    15x15 and the other way around, from 15x15 to 13x13?
  26.  
  27. Yes, you are wrong, luckily. :-)
  28. You can scale both up and down, and by any factor.
  29.  
  30. These are the fields you need to set:
  31.  
  32.  bitscale->bsa_SrcX          = 0;
  33.  bitscale->bsa_SrcY          = 0;
  34.  bitscale->bsa_SrcWidth      = src_width;
  35.  bitscale->bsa_SrcHeight     = src_height
  36.  bitscale->bsa_DestX         = 0;
  37.  bitscale->bsa_DestY         = 0;
  38.  bitscale->bsa_XSrcFactor    = src_width;
  39.  bitscale->bsa_YSrcFactor    = src_height;
  40.  bitscale->bsa_XDestFactor   = dst_width;
  41.  bitscale->bsa_YDestFactor   = dst_height;
  42.  bitscale->bsa_SrcBitMap     = src_bitmap;
  43.  bitscale->bsa_DestBitMap    = dst_bitmap;
  44.  bitscale->bsa_Flags         = 0;
  45.  
  46. You don't need to set bsa_DestWidth or bsa_DestHeight, since they
  47. are only written to by the function, and never read.
  48.  
  49. --
  50. Lars Haugseth
  51.  
  52. -- 
  53. Lars Haugseth <larshau@ifi.uio.no>
  54.  
  55.