home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3636 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  54 lines

  1. Path: yama.mcc.ac.uk!dmu!usenet
  2. From: Timothy Eves <se1te@dmu.ac.uk>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Scaling
  5. Date: Thu, 22 Feb 1996 19:16:24 +0000
  6. Organization: De Montfort Univerity
  7. Message-ID: <312CC108.71@dmu.ac.uk>
  8. References: <1588.6626T1061T1294@sn.no>
  9. NNTP-Posting-Host: birch.cms.dmu.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/720)
  14.  
  15. Long time scince I've used the BitMapScale but I think you've missed out
  16. the bsa_XSrcFactor and bsa_YSrcFactor.  Any way there are a set of 2
  17. pairs of fileds that contoll the scaling ratio.  Into the bsa_#SrcFactor
  18. fileds you put the denominator of you scale ratio. Into the
  19. bsa_#DestFactor you put the numerator
  20.  
  21. There for if you want scale a 320x256 bit map to 1/3 along x and 2/5
  22. along you go:
  23.  
  24. struct BitScaleArgs bitscale = {0}; // Put all fields to 0.
  25.  
  26. bitscale.bsa_SrcWidth      = Width;     // Soruce Width
  27. bitscale.bsa_SrcHeight     = Height;    // Source Height
  28. bitscale.bsa_XSrcFactor    = 2;        // Scale factor denominator X
  29. bitscale.bsa_YSrcFactor    = 5;        // Scale factor denominator Y
  30. bitscale.bsa_XDestFactor  = 1          // Scale factor numerator X
  31. bitscale.bsa_YDestFactor  = 2          // Scale factor numerator Y
  32. bitscale.bsa_SrcBitMap    = BitMap;     // Source BitMap
  33. bitscale.bsa_DestBitMap   = newbitmap;  // Destination BitMap
  34.  
  35. BitMapScale(bitscale&);
  36.  
  37. If you want to enlarge BitMaps just make the fractions top heavy i.e.
  38. make the numerator bigger than the denominator to to twice the width use
  39. a ration of 2/1.
  40.  
  41. If memory serves the bsa_DestWidth/Height fileds contain the size of the
  42. scaled are after the operation and are filled in by BitMapScale().
  43.  
  44. If you still have trouble or I've made some mistakes the Mail me and
  45. I'll send you some source I wrote using BitMapScale() that works.
  46.  
  47. Tim Eves 
  48. ------------------------------------------------------------O----------------    
  49. Out of the gloom came a voice, "Smile  and  be  happy things| EMail To:
  50. could  be  worse",  it  said.  So I smiled and I was  happy,|
  51. se1te@dmu.ac.uk
  52. and  behold  things  did  get worse.                |
  53. ------------------------------------------------------------O----------------
  54.