Short: Picture magnifying class for BGUI including source code Author: Reinhard Katzmann (suamor@student.uni-tuebingen.de) Uploader: Reinhard Katzmann (suamor student uni-tuebingen de) Type: dev/gui Replaces: dev/gui/MagnifyClass.lha Architecture: m68k-amigaos Small Bugfixes: - TestMagnify demos now also run on a 640x256 screen (instead only on >640x400) - RESTRACK option disabled for link & shared library MagnifyClass Version 39.2 ------------------------- MagnifyClass is (C) 1995/96 by Reinhard Katzmann and FREEWARE. All Rights reserved. Introduction ------------ Old users: Read the Changes section! Warning: You _must_ replace the old magnify_bgui.gadget before using the shared lib demo or your system may crash! This is the second release of Magnifyclass, a picture sizing (or magnify- ing) class for BGUI. I've included a test program (testmagnifyclass) for playing around. For closer information read magnifyclass.doc. If you don't know what the hell BGUI is, read the BGUI.intro text file :-) The usage of the class is similar to paletteclass or popbuttonclass which came both with BGUI12. The class was written with SAS/C6.56 but should work fine with other compilers, too. Please tell mel if you have any problems compiling the class. If you have compiled the class, simply link it with your program using the class. SAS/C-User may not forget to set the NOSTACKCHECK Option!! (This should belong to th BGUI-FAQ ;-) Copyright & Disclaimer ---------------------- MagnifyClass is (C) 1995/96 by Reinhard Katzmann. All Rights reserved. MagnifyClass is FREEWARE, i.e. you must not pay me anything using it with Public Domain, Freeware, Shareware and Giftware programs. Usage in commercial programs is NOT allowed without the written permission from me! It may and should be distributed on the BGUI Home Page and to the BGUI ftp server(s). Ian J. Einman has the exclusive right to add the (hopefully) bug-free version with the coming BGUI release(s). Distribution ------------ You may distribute this class freely as long as you don't charge any money for it. It may not be uploaded on any BBS which claim copyright on uploaded material. It may be only distributed as long as no profit is made out of it. If you want to distribute this archive on a magazine coverdisk you must send me a complimentery copy of the magazine issue in which it appears to my home address (see Cnntacting below). It may be freely included in PD Series or CD ROMs like the Aminet/Fresh Fish CD or Times series. Changes ------- V39.2 - Completely compiled with SAS/C 6.57 - MAGNIFY_GrapWidth/Height values are no longer width and height of the object but the size of the picture and they are no longer settable in initilisation - Consequently the object is no longer forced to use MAGNIFY_GrapWidth/Height as minimum dimensions. - You can instead use MAGNIFY_ScaleWidth/Height to specify which percentage of the picture you always want to view (only for startup) - Use MAGNIFY_BoxWidth/Height to be notified when the size of the window and thus the size of the magnify object changes. - Object size does not need to ne fixed any longer. Removed many problems with setting (left mouse button) and rendering to make this possible - Grid was drawn one pixel to large (both width & height) - RenderBitMap() used a wrong reference to the RastPort Usage ----- You need to have installed bgui.library V39 or better. Also the demo program uses iff.library for loading iff images. There exist two (or three) possibilities to use it. Either you use it as external gadget class (this is important if you don't program in C/C++ and you can not include SAS/C link libs in your code) or as an SAS/C (Dice/GCC ?) Link Library. You also can simply compile it and include the resulting object file. Warning: I did not create an option in the smakefile for DATA=FAR (i.e. tell the compiler to use 32 bit-references instead of 16bit). But I don't think it's difficult for you to add it, in case you need it in your application. I would not use it as external (shared library) gadget class because the size of gadget class + app is ~10k bigger than using it with link lib. It would only be useful if many apps are using it or if the language you are programming is unable to understand SAS/C object code or any other you may generate (like with the free version of DICE or with gcc). Warning: I did not test it under V37. This mainly concerns the Alloc/Free functions of the bitmaps. Source Code: ------------ The source code is provided to compile and to link with your program. It may not be changed or altered in any way! If you have ideas for improving it somehow please send them to me and I then will consider implementing them (of course I keep the last word). In no case you may make a new magnifying class out of this source. But you are allowed to make a new class out of it that has really other aims than this class. This new class must be distributed under the same condition as the using (i.e. it may NOT be sold commercial!). If you decide to do so you must state in your documentation the line: "This class is based on MagnifyClass (c) 1995/96 Reinhard Katzmann" (as I have stated in my source code on which it is based). If there are any problems with Dice/GCC compiler building a link library you should try to solve it (I don't own/use either) and send me diffs so I my be able to include them in a new release. Please use #ifdef _GCC or similar to indicate the changes. Resource Tracking: If you turn it on, you will notice that the executables nearly double in size. I decided to not distribute such a Version. Disclaimer ---------- This program is provided "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and the performance of this collection is with you. In no event can I be liable to you for damages of any kind arising out of the use of this program or any part of it's archive, or the inability to use it. Known Bugs ---------- I have problems with allocating the correct size of the temporary bitmap. Currently I use ( Magfactor + Grid (if present) ) multiplied by the size of the part of the image which is to be shown plus (and this is what I find very strange) the Start point of the image. If I do omit the last I get Mungwall/Enforcer Hits (i.e. it goes beyond the size of the allocated bitmap). I can't explain why this happens because the size of the partly shown image must still be the same. This is also a prove to me that ScalerDiv() must be wrong, because if it was true, the above problem may not appear. At startup only a black rectangle is drawn in the window frame (In BGUI 41.7 it is drawn in the object itself). This happens since V39.2 but I could not figure out which change could have caused it. A refresh solves the problem. The demo does loading/saving of pictures using iff.library which is based on V37, so uses RGB4 colortables instead of RGB32. This may lead to difficulties. I'd like to have load/save functions which work on both V37 and V39 (+ GFX boards as I have a Picasso II, but not dependant on WB-Emu Software if possible). If you can help me with that or have a function/link lib supporting loading and saving in an OS-legal way on both V37 and V39 and want to share it, let me know about it. Future: ------- This is the last release which supports Version 39 of BGUI. The next version will require V41.7. Therefore this archive is called MagnifyClass39.lha. This version will be still maintained (bugs etc.) until the new BGUI 2.0 release. Also I will drop the link library support in the next Version as it is only useful for 68k SAS/C Users. In effect you won't notice any difference. Using the shared library will be much easier (as will all BGUI external libraries). As BGUI V41 supports allocating of Bitmaps for both V37 and V39, I will use these functions in the next release and the my own methods will be removed. Also the documentation is not really AutoDoc conform. This will be changed. If anyone needs it: I may support reduction of bitmaps (to get an overview if you have very large pictures) with another attribute. Also I might add a extra method for setting a pixel directly into the picture. Else I will mainly concentrate on removing bugs. The class itself does not need to be further extended (at least I have no ideas). The demo could support Datatypes for loading/saving images on V39+ systems. Also I would be possible to add a palette selector gadget so you can draw in different colours. Further expansions are up to you ;) (You can make a real WB paint program out of it if you want to - but if you decide to go Shareware I want a free Version!). Send me all you ideas/bugs (else I have no motivation to continue it). Contacting: ----------- Send bugs, comments, ideas, flames to: E-MAIL (preferred): ------------------- suamor@student.uni-tuebingen.de Reinhard_Udo.Katzmann@student.fh-reutlingen.de SnailMail: ---------- Reinhard Katzmann Schellingstraße 41 D - 72072 Tübingen BBS'es ------ You can try to reach me through BBS'es near Tübingen. Some of the Sysops might know me or have contact to the Internet. I'm only User of one BBS: Onkel Helmut's Hütte Line 1: (0049) +7157/64546 (28800 Baud) Line 2: (0049) +7157/65428 (14400 Baud) My usual Nickname on the internet or at this BBS is Suamor.