Unit Zoompic

TZoomImage A tImage derivative that supports zooming. This component is postcardware: if you like it and use it, send me a postcard at Grahame Grieve Biochemistry St Vincent's Hospital Fitzroy 3065 Australia Disclaimer: I'm not responsible for any mishaps that result from the use of this component/code. This code is copyright © Grahame Grieve, g.grieve@pgrad.unimelb.edu.au Description: this component shows a bitmap, like TImage, but you can control the zooming of the bitmap. The component is for both versions of Delphi. Version 1.1: Automatic mouse zooming. 5/8/1996 bugs: In Delphi32 some images (b/w) don't load properly. I don't know why (p.s. if you find out, email me with the answer). >>>>>> How to use this component: <<<<<<<<<<< how to set zoom: 1. you can set autofit to fit the picture. When autofit is true the other properties become effectively read-only. but setting them sets autofit to false 2. You can use zoomvalue and xcentre,ycentre if you set any of these values, the others are held constant, and the visXXX values all change. if the x and y zooms are different, zoomvalue returns the average of the 2 values. When you set ZoomValue, both are set to the same value. ZoomValue is a percent of picture size on a bit for bit basis. At 100% there is a 1 to 1 bit copy. 3. You can use vistop - visright. if you set one of these, the others remain constant, and the values for zoomvalue and y/x centre change. 4. New!! the image automatically responds to a mouse drag by zooming to the are selected. single click clears the zooming. Rules for picture sizing: * when there is no loaded picture, these values cannot be changed. * if the bitmap is changed, then it will be automatically scaled to fit. * You can refit the picture at any time by calling autofit, or setting zoomValue to 0. * at no time can the visible area of the bitmap become smaller than the actual size of the client rect. i.e. Requests to set visXXX outside the bounds of the bitmap result in the value of visXXX being scaled to the limit. * abs(visRight - VisLeft) must > mindiff abs(VisBottom - VisTop) must > minDiff

Classes

TZoomImage - controls the zoom limit of the bitmap

Functions

Register -

Types

Constants

minDiff

Variables


Functions


procedure Register;


Types


Constants

minDiff = 10


Variables