Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!hp4nl!rivm!ccemdd From: ccemdd@rivm.UUCP (Marco Dedecker) Newsgroups: comp.sys.amiga Subject: Re: how does one change the size of an iff picture Message-ID: <1353@rivm05.UUCP> Date: 1 Jun 89 07:28:40 GMT References: <16520@louie.udel.EDU> Organization: RIVM, Bilthoven, The Netherlands Lines: 51 In article <16520@louie.udel.EDU>, MFM1%LEHIGH.BITNET@ibm1.cc.lehigh.edu (mark masters) writes: > > > Okay, I've a question on how one could zoom in on a section of an IFF > picture from within a program. That is to say I've been working on an > animation program, and I need to zoom in on a picture which has been > loaded into memory and I have no Idea on how to change its size. Any > help will be tremendously, incredibly, hugely appreciated. > > mark > Well actually, you can change the size of it, but by doing that you won't zoom in. If you want to zoom in you have to calculate a new screen. In order to do this you have to know where you can find the bitmaps of your IFF picture. Suppose : - You have a picture 320*200, 5 bitplanes (32 colors). - You wish to zoom in a screen of lets say 160*100 (1/4 of the screen). - You wish to zoom in on the upper left corner (where X is). (0,0) (160,0) (320,0) X (0,100) (160,100) (320,100) (0,200) (160,200) (320,200) What do you do : - You define a second screen (320*200, 5 bitplanes). - You take the 1st bit from the first line of your original picture, and you display it twice on the first line of the new screen. - After one line is done you duplicate the first line of the new picture to the second line of the new picture. Example : The 1st byte of your picture : 10101100 On the new picture it will become : 1100110011110000 1100110011110000 Keep in mind that if you are using this methode it will eat A LOT of CPU time. You could try creating the new picture in fases (one bitplane every vblank). You might also try using the blitter to create the new picture. I don't know if this is what you had in mind, but I hope it will be of some help. Marco Dedecker