TSCLED 1.0 Dec 29, 2001 by Safak Cinar scinar@shaw.ca http://members.shaw.ca/safak Based on the component TDynaLED 1.0 by Samson Fu LEGAL ===== You are free to use and modify this component in any project (freeware or commercial) but cannot sell or distribute the component itself (whether as source code or in compiled form), individually or bundled in a package without prior written consent from the author. That out of the way, feel free to modify the code. If you publish your own component based on this one, make it freeware with full source code and drop me a note. Alternatively, you can send me your ideas, suggestions and bug reports and I will try to include the functionality in the next version, with proper credit of course. DESCRIPTION =========== TSCLED is a multiline dot matrix LED display emulator that uses a monochrome offscreen bitmap to draw on. Text can be displayed using any installed font and it has a dozen or so built in animation sequences and custom draw functionality. TSCLED is based on the component TDynaLED 1.0 by Samson Fu. You can download his component from http://www.torry.net/leds.htm. TSCLED displays a monochrome bitmap (accessible through BITMAP property) with adjustable pixel size and inter pixel spacing. Although this BITMAP is exposed, you need not use it directly when simply displaying text, which you do by assigning strings to either the CAPTION or LINES properties. Most of the features are quite straightforward, with a couple of exceptions: * For LEDSTYLE, sclsSQUARE and sclsROUND yield identical looking displays unless LEDSIZE is larger than 2 pixels. * TSCLED has both a LINES and a CAPTION property. If LINES is empty, CAPTION is used,otherwise LINES is used. It is a little easier using LINES at design time when entering multi-line text. * The AUTOSIZE property may not be what you expect. If it is set to true, any change in LEDSIZE, LEDDISTANCE or LEDCOUNTX or LEDCOUNTY will change the component size, in other words, component WIDTH and HEIGHT become derived properties. Otherwise, LEDCOUNTX and LEDCOUNTY are derived from the other properties. Mainly a design time convenience. * CLIPMODE can either be set to sccmTEXT or sccmDISPLAY. If set to sccmTEXT, the monochrome BITMAP will be the minimum size to accomodate the text drawn on it. Otherwise, the BITMAP will be the same size as display (ie LEDCOUNTX by LEDCOUNTY pixels). To better visualize this, enable ONAFTERDRAW on the this demo page, which will draw a frame around the BITMAP. As a rule of thumb, use sccmTEXT unless you are doing custom drawing. * ALIGNMENTH doesn not use Delphi's TALIGNMENT values but a custom enumerated type. This is in anticipation of a later feature. ANIMATION ========= The ANIMATE method takes 6 arguments: Procedure Animate(Style,Interval,Steps:Integer;P1,P2,P3:Integer); Style : 1..13, the various animation styles. Interval : (Minimum) duration, in milliseconds, of each animation step Steps : The total number of animation steps P1,P2,P3 : Parameters. These are specific to each animation style. Animation Styles: 1 : Blink Foreground (no parameters) 2 : Blink Background (no parameters) 3 : Blink background and foreground (ie. Toggle) (no parameters) 4 : Stretch X P1 = Angle (*1) increment (in degrees). P2 = X coordinate of the vertical center line (*2) 5 : Stretch Y P1 = Angle (*1) increment (in degrees). P2 = Y coordinate of the horizontal center line (*2) 6 : Flip X P1 = Angle increment (in degrees). P2 = X coordinate of the vertical center line (*2) 7 : Flip Y P1 = Angle increment (in degrees). P2 = Y coordinate of the horizontal center line (*2) 8 : Pulasate P1 = Angle (*3) increment (in degrees). P2 = X coordinate of the center point (*2) P3 = Y coordinate of the center point (*2) 9 : Rotate P1 = Angle increment (in degrees). For full cycle rotation Steps*P1 has to be a multiple of 360. P2 = X coordinate of the center point (*2) P3 = Y coordinate of the center point (*2) 10: Scroll X P1 = Pixel increment (can be negative). P2 = Wraparound value. After this many pixels, "what goes around comes around". For nice cyclic animation, make sure that a. Steps is larger than or equal to Bitmap.Width or GetLEDCountX (depending on ClipMode). b. Wraparound value is a multiple of pixel increment and steps. 11: Scroll Y P1 = Pixel increment (can be negative). P2 = Wraparound value. Same considerations for "Scroll X" apply. 12: Wipe X P1 = Pixel increment (can NOT be negative). 13: Wipe Y P1 = Pixel increment (can NOT be negative). Notes: (1) Stretching uses cosecant in the transformation filter, hence the angle. (2) Center of display is "SCLED.LEDCountX Div 2, SCLED.LEDCountY Div 2" Center of text is "SCLED.Bitmap.Width Div 2, SCLED.Bitmap.Height Div 2" In the demo animations display center has been used. (3) Pulsating uses cosine in the transformation filter, hence the angle.