谢谢各位了!

解决方案 »

  1.   

    http://www.neweasier.com/vcl.html?class=46里面有n个带源码的
      

  2.   

    Raize3.0.10三方控件包中有的有源代码很好用的 在 Raize Display页
      

  3.   

    unit Lcd99;{  LCD display component written by Jonathan Hosking, June 2000.   Get future component updates from the following address
       Website: http://www.the-hoskings.freeserve.co.uk/   Send any bugs, suggestions, etc to the following Email
       Email: [email protected]   Thanks to Jean Pierre for helping with the drawing routines
       Email: [email protected]   Thanks to Daniel Szasz for implementing support for colon characters
       Email: [email protected]   Thanks to Alan Warriner for implementing double buffering, the
       animation preview feature, and improving the animation delays
       Email: [email protected]  }interfaceuses
      {$IFDEF WIN32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
      Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      Menus;type
      TLCDScale = 1..100;
      TLCDAnimation = (anNone,anSpiral,anUp,anDown,anLeft,anRight,anRandom);
      TLCDAbout = (abNone,abAbout);
      TLCD99 = class(TCustomControl)
      private
        { Private declarations }
        fAbout: TLCDAbout;
        fAnimation: TLCDAnimation;
        fAnimationDelay: Integer;
        fBufferBM: TBitmap;
        fDigitNum: Integer;
        fDigitSpacing: Integer;
        fDoBuffer:Boolean;
        fDoubleBuffer: Boolean;
        fGapX: Integer;
        fGapY: Integer;
        fIsChanging: Boolean;
        fIsPainting: Boolean;
        fOffColor: TColor;
        fOldValue: String;
        fOnColor: TColor;
        fPaintDuration: {$IFDEF WIN32}DWord{$ELSE}Longint{$ENDIF};
        fPreview: Boolean;
        fSegmentSize: Integer;
        fValue: String;
        fWorkCanvas: TCanvas;
        procedure SetAnimation(Val: TLCDAnimation);
        procedure SetAnimationDelay(Val: Integer);
        procedure SetDigitNum(Val: Integer);
        procedure SetDigitSpacing(Val: Integer);
        procedure SetDoubleBuffer(Val: boolean);
        procedure SetGapX(Val: Integer);
        procedure SetGapY(Val: Integer);
        procedure SetOffColor(Val: TColor);
        procedure SetOnColor(Val: TColor);
        procedure SetSegmentSize(Val: Integer);
        procedure SetPreview(Val: boolean);
        procedure SetValue(Val: String);
        procedure ShowAbout(Val: TLCDAbout);
        procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message wm_EraseBkgnd;
      protected
        { Protected declarations }
        procedure Paint; override;
      public
        { Public declarations }
        constructor Create(AOwner: TComponent); override;
      published
        { Published declarations }
        property About: TLCDAbout read fAbout write ShowAbout default abNone;
        property Align;
        property Animation: TLCDAnimation read fAnimation write SetAnimation default anNone;
        property AnimationDelay: Integer read fAnimationDelay write SetAnimationDelay default 0;
        property DoubleBuffer: Boolean read fDoubleBuffer write SetDoubleBuffer default true;
        property Color;
        property DragCursor;
        property DragMode;
        property Enabled;
        property DigitNum: Integer read fDigitNum write SetDigitNum default 1;
        property DigitSpacing: Integer read fDigitSpacing write SetDigitSpacing default 5;
        property GapX: Integer read fGapX write SetGapX default 2;
        property GapY: Integer read fGapY write SetGapY default 2;
        property IsPainting: Boolean read fIsPainting;
        property OffColor: TColor read fOffColor write SetOffColor default clBlack;
        property OnColor: TColor read fOnColor write SetOnColor default clLime;
        property PaintDuration: {$IFDEF WIN32}DWord{$ELSE}Longint{$ENDIF} read fPaintDuration;
        property ParentShowHint;
        property PopupMenu;
        property Preview: Boolean read fPreview write SetPreview default false;
        property SegmentSize: Integer read fSegmentSize write SetSegmentSize default 2;
        property ShowHint;
        property Value: String read fValue write SetValue;
        property Visible;
        property OnClick;
        property OnDblClick;
        property OnDragDrop;
        property OnDragOver;
        property OnEndDrag;
        property OnMouseDown;
        property OnMouseMove;
        property OnMouseUp;
      end;procedure Register;implementation{ TLCD99 }const
      CopyRightStr: PChar = 'TLCD Component v1.65 (03/06/2000)'+#13+#13+
        'By Jonathan Hosking'+#13+#13+
        'Compiled in '+
        {$IFDEF VER80}  'Delphi 1.0' {$ENDIF}
        {$IFDEF VER90}  'Delphi 2.0' {$ENDIF}
        {$IFDEF VER100} 'Delphi 3.0' {$ENDIF}
        {$IFDEF VER120} 'Delphi 4.0' {$ENDIF}
        {$IFDEF VER130} 'Delphi 5.0' {$ENDIF}
        {$IFDEF VER140} 'Delphi 6.0' {$ENDIF};
      { ---1---    This next array stores the digits (0 - 36)
        |     |    and the segments (1 - 7).  The diagram on
        2  8  3    the left shows the layout of the segments.
        |     |    A 1 enables the segment, while a 0 will
        ---4---    turn the segment off.  An 8 will display
        |     |    a colon.
        5  8  6
        |     |
        ---7--- }  LCDDisplayData: Array[0..37,1..8] of integer =
                        { Numbers, minus sign and colon }
                        ((1,1,1,0,1,1,1,0),(0,0,1,0,0,1,0,0),(1,0,1,1,1,0,1,0),
                        (1,0,1,1,0,1,1,0),(0,1,1,1,0,1,0,0),(1,1,0,1,0,1,1,0),
                        (1,1,0,1,1,1,1,0),(1,0,1,0,0,1,0,0),(1,1,1,1,1,1,1,0),
                        (1,1,1,1,0,1,1,0),(0,0,0,1,0,0,0,0),(0,0,0,0,0,0,0,1),
                        { Letters of the alphabet }
                        (1,1,1,1,1,1,0,0),(0,1,0,1,1,1,1,0),(1,1,0,0,1,0,1,0),
                        (0,0,1,1,1,1,1,0),(1,1,0,1,1,0,1,0),(1,1,0,1,1,0,0,0),
                        (1,1,0,1,1,1,1,0),(0,1,0,1,1,1,0,0),(0,0,1,0,0,1,0,0),
                        (0,0,1,0,0,1,1,0),(0,1,1,1,1,1,0,0),(0,1,0,0,1,0,1,0),
                        (0,0,0,1,1,1,0,0),(0,0,0,1,1,1,0,0),(0,0,0,1,1,1,1,0),
                        (1,1,1,1,1,0,0,0),(1,1,1,1,0,1,0,0),(0,0,0,1,1,0,0,0),
                        (1,1,0,1,0,1,1,0),(0,1,0,1,1,0,0,0),(0,1,1,0,1,1,1,0),
                        (0,1,1,0,1,1,1,0),(0,1,1,0,1,1,1,0),(0,1,1,1,1,1,0,0),
                        (0,1,1,1,0,1,0,0),(1,0,1,1,1,0,1,0));  { This array stores the animation details, starting at anSpiral }
      LCDAnimationData: Array[1..5,1..8] of integer =
                          ((8,4,2,1,3,6,7,5),(7,6,5,8,4,3,2,1),
                          (1,2,3,8,4,5,6,7),(6,3,7,8,4,1,5,2),
                          (2,5,1,8,4,7,3,6));var
      CopyRightPtr: Pointer;constructor TLCD99.Create(AOwner: TComponent);
    begin
      { Setup the control }
      Inherited Create(AOwner);
      ControlStyle:=ControlStyle+[csOpaque];
      CopyRightPtr := @CopyRightStr;
      Color := clBlack;
      fAbout := abNone;
      fAnimation := anNone;
      fAnimationDelay := 0;
      fBufferBM := nil;
      fDigitNum := 4;
      fDigitSpacing := 5;
      fDoubleBuffer:=true;
      fGapX := 2;
      fGapY := 2;
      fIsChanging := False;
      fIsPainting := False;
      fOffColor := clBlack;
      fOnColor := clLime;
      fPaintDuration := 0;
      fSegmentSize := 2;
      fOldValue := '';
      fValue := '';
      Width := 92;
      Height := 34;
    end;procedure TLCD99.SetAnimation(Val: TLCDAnimation);
    begin
      { The control doesn't need updating here }
      if fAnimation <> Val then
        fAnimation := Val;
    end;procedure TLCD99.SetAnimationDelay(Val: Integer);
    begin
      { The control doesn't need updating here }
      if fAnimationDelay <> Val then
        fAnimationDelay := Val;
    end;procedure TLCD99.SetDigitNum(Val: Integer);
    begin
      if fDigitNum <> Val then
      begin
        fDigitNum := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetDigitSpacing(Val: Integer);
    begin
      if fDigitSpacing <> Val then
      begin
        fDigitSpacing := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetDoubleBuffer(Val: boolean);
    begin
      fDoubleBuffer:=Val;
    end;procedure TLCD99.SetGapX(Val: Integer);
    begin
      if fGapX <> Val then
      begin
        fGapX := Val;
        Invalidate;
      end;
    end;
      

  4.   

    procedure TLCD99.SetGapY(Val: Integer);
    begin
      if fGapY <> Val then
      begin
        fGapY := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetOffColor(Val: TColor);
    begin
      if fOffColor <> Val then
      begin
        fOffColor := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetOnColor(Val: TColor);
    begin
      if fOnColor <> Val then
      begin
        fOnColor := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetSegmentSize(Val: Integer);
    begin
      if fSegmentSize <> Val then
      begin
        fSegmentSize := Val;
        Invalidate;
      end;
    end;procedure TLCD99.SetPreview(Val: boolean);
    begin
      fPreview:=Val;
      if Val then Invalidate;
    end;procedure TLCD99.SetValue(Val: String);
    var
      Count: Integer;
      Invalid: Boolean;
    begin
      if fValue <> Val then
      begin
        { For this bit, we check the validity of the string }
        Invalid := False;
        if Val <> '' then
          for Count := 1 to length(Val) do
          begin
            Val[Count] := Upcase(Val[Count]);
            if not(((Val[Count] >= '0') and (Val[Count] <= '9')) or
              (Val[Count] = '-') or (Val[Count] = ' ') or (Val[Count] = '.') or
              ((Val[Count] >= 'A') and (Val[Count] <= 'Z')) or
              (Val[Count] = ':' )) then
                Invalid := True;
          end;
        if Invalid then Val := '';
        { We don't allow decimal points on the end of the value }
        if (Val <> '') and (Val[length(Val)] = '.') then Delete(Val,length(Val),1);
        fValue := Val;
        { Turn on animation }
        fIsChanging:=true;
        Invalidate;
      end;
    end;procedure TLCD99.ShowAbout(Val: TLCDAbout);
    begin
      if fAbout <> Val then
      begin
        if Val = abNone then fAbout := Val else
        begin
          fAbout := abNone;
          MessageDlg(StrPas(CopyRightStr), mtInformation, [mbOk], 0);
        end;
        Invalidate;
      end;
    end;procedure TLCD99.WMEraseBkgnd(var Message: TWMEraseBkgnd);
    begin
       Message.Result := 1;
    end;{ Thanks to Alan Warriner for adding double buffering, animation
      previews, and improved animation delays }
    procedure TLCD99.Paint;
    var
      AnimationNo: Byte;
      tmp,tmp2,tmp3,tmp4: string;
      PaintStart,FirstTickCount:{$IFDEF WIN32}DWord{$ELSE}Longint{$ENDIF};
      HG, HH, HW, tmpDelay, VG, VH, VW: Integer;{ Draw a vertical segment - Thanks to Jean Pierre for his help }
    procedure DrawVerticalSegment(StartX,StartY,XSpace,YSpace: Integer; SColor:TColor);
    var
      HalfY: Integer;
    begin
      with fWorkCanvas do
      begin
        Brush.Color := SColor;
        Pen.Color := SColor;
        HalfY := StartY + round(YSpace/4);
        Polygon([Point(StartX,HalfY),
                 Point(StartX+(HW div 2),StartY),
                 Point((StartX+XSpace)-(HW div 2),StartY),
                 Point(StartX+XSpace,HalfY),
                 Point((StartX+XSpace)-HW,StartY+YSpace),
                 Point(StartX+HW,StartY+YSpace),
                 Point(StartX,HalfY)]);
      end;
    end;{ Draw the centre segment }
    procedure DrawCenterSegment(StartX,StartY,XSpace,YSpace: Integer; SColor:TColor);
    var
      HalfY: Integer;
    begin
      with fWorkCanvas do
      begin
        Brush.Color := SColor;
        Pen.Color := SColor;
        HalfY := StartY + round(YSpace/2);
        Polygon([Point(StartX,HalfY),
                 Point(StartX+HW,StartY),
                 Point((StartX+XSpace)-HW,StartY),
                 Point(StartX+XSpace,HalfY),
                 Point((StartX+XSpace)-HW,StartY+YSpace),
                 Point(StartX+HW,StartY+YSpace),
                 Point(StartX,HalfY)]);
      end;
    end;{ Draw a horizontal segment - Thanks to Jean Pierre for his help }
    procedure DrawHorizontalSegment(StartX,StartY,XSpace,YSpace: Integer; SColor:TColor);
    var
      HalfX: Integer;
    begin
      with fWorkCanvas do
      begin
        Brush.Color := SColor;
        Pen.Color := SColor;
        HalfX := StartX + round(XSpace/4);
        Polygon([Point(HalfX,StartY),
                 Point(StartX,StartY+(VH div 2)),
                 Point(StartX,(StartY+YSpace)-(VH div 2)),
                 Point(HalfX,StartY+YSpace),
                 Point(StartX+XSpace,(StartY+YSpace)-VH),
                 Point(StartX+XSpace,StartY+VH),
                 Point(HalfX,StartY)]);
      end;
    end;{ Draw a colon - Thanks to Daniel Szasz for his help }
    procedure DrawColon(StartX1,StartY1,StartX2,StartY2,XSpace,YSpace: Integer; SColor:TColor);
    begin
      with fWorkCanvas do
      begin
        Brush.Color := SColor;
        Pen.Color := SColor;
        Ellipse(StartX1,StartY1,StartX1+XSpace,StartY1+YSpace);
        Ellipse(StartX2,StartY2,StartX2+XSpace,StartY2+YSpace);
      end;
    end;{ And here's the clever procedure that draws the digits WITHOUT using
      bitmaps! }
    procedure DrawDigit(Animation, Speed: Integer;SkipSome:Boolean);
    var
      AnimationCount, SegmentNo: Byte;
      AValue, CH, CW, DelayCorrection, DigitNumber, DrawX, DrawY,
        SegmentSpaceX, SegmentSpaceY, Spacing: Integer;
      SColor: TColor;
      DigitOn: Boolean;
      SegmentDelay,DelayTicks,FirstSegmentTickCount:{$IFDEF WIN32}DWord{$ELSE}Longint{$ENDIF};
      

  5.   

    begin
      with fWorkCanvas do
      begin
        { We start counting the whole delay here, as time can be wasted
          drawing the display.  A delay of 1000 MUST last around 1 second }
        { Just to ensure that everything is drawn.  The canvas doesn't always
          draw along the edges, rather irritatingly }
        CH := Height - 1;
        CW := Width - 1;
        { Prepare to draw }
        Brush.Style := bsSolid;
        AnimationCount := 0;
        { Work out segment sizes }
        Spacing := fDigitSpacing + 1;
        SegmentSpaceX := (CW - (fDigitNum * Spacing)) div fDigitNum;
        SegmentSpaceY := CH;
        { Each segment needs a corner gap.  We use this to work out the segment
          height and width.  These next variables are named as follows: -      H- = Horizontal Segment, V- = Vertical Segment
          -G = Corner gap, -H = Height, -W = Width }
        HG := fGapY;
        VG := fGapX;
        VH := fSegmentSize;
        HW := fSegmentSize;
        VW := SegmentSpaceX - (2 * VG);
        HH := (SegmentSpaceY div 2) - (2 * HG);
        { Draw the decimal points }
        for DigitNumber := 1 to fDigitNum do
          if (tmp3[DigitNumber] <> tmp4[DigitNumber]) or (not SkipSome) then
          begin
            if tmp3[DigitNumber] = '.' then
            begin
              Brush.Color := fOnColor;
              Pen.Color := fOnColor;
            end
            else
            begin
              Brush.Color := fOffColor;
              Pen.Color := fOffColor;
            end;
            DrawX := (DigitNumber - 1) * (SegmentSpaceX + Spacing) + 2;
            Rectangle(DrawX,SegmentSpaceY - (Spacing - 3),DrawX + (Spacing - 3),SegmentSpaceY);
          end;
        { Here we see how much delay time is left }
        Speed := (Speed - Integer(GetTickCount - FirstTickCount)) div 7;
        if Speed < 0 then Speed := 0;
        DelayCorrection:=0;
        repeat
          { Now we start the delay count.  The reason for this is that some
            of the delay time can be spent updating the actual segments, so
            a delay of 1000 MUST last 1 second.  The delay is equally divided
            by 8, as there are 8 segments to update }
          FirstSegmentTickCount := GetTickCount;
          { Continue the animation }
          inc(AnimationCount);
          if Animation<>0 then
            SegmentNo := LCDAnimationData[Animation,AnimationCount]
          else
            SegmentNo:=LCDAnimationData[3,AnimationCount];
          for DigitNumber := 1 to fDigitNum do
            if (tmp[DigitNumber] <> tmp2[DigitNumber]) or (not SkipSome) then
            begin
              { Reset the digit index }
              AValue := 8;
              { Get the current digit details }
              if tmp[DigitNumber] = ' ' then
              begin
                AValue := 8;
                DigitOn := false;
              end
              else
              begin
                { Convert the letters, numbers and minus sign
                  to the correct digit index }
                case tmp[DigitNumber] of
                  '-': AValue := 10;
                  ':': AValue := 11;
                  '0'..'9': AValue := StrToInt(tmp[DigitNumber]);
                  'A'..'Z': AValue := Ord(tmp[DigitNumber]) - 53;
                end;
                DigitOn := true;
              end;
              { Set the color }
              if (DigitOn) and (LCDDisplayData[AValue,SegmentNo] = 1) then
                SColor := fOnColor
              else
                SColor := fOffColor;
              { Now we set the positions and draw the segment }
              DrawX := ((DigitNumber - 1) * SegmentSpaceX) + (DigitNumber * Spacing);
              case SegmentNo of
                1,7: begin
                       { Top and bottom segments }
                       Inc(DrawX,VG);
                       if SegmentNo = 1 then
                       begin
                         DrawY := 0;
                         DrawVerticalSegment(DrawX,DrawY,VW,VH,SColor);
                       end
                       else
                       begin
                         DrawY := SegmentSpaceY;
                         DrawVerticalSegment(DrawX,DrawY,VW,-(VH),SColor);
                       end;
                     end;
                4: begin
                     { Centre segment }
                     Inc(DrawX,VG);
                     DrawY := (SegmentSpaceY div 2) - (VH div 2);
                     DrawCenterSegment(DrawX,DrawY,VW,VH,SColor);
                   end;
                2,5: begin
                       { Left segments }
                       if SegmentNo = 2 then DrawY := HG
                         else DrawY := (SegmentSpaceY div 2) + HG;
                       DrawHorizontalSegment(DrawX,DrawY,HW,HH,SColor);
                     end;
                3,6: begin
                       { Right segments }
                       Inc(DrawX,SegmentSpaceX);
                       if SegmentNo = 3 then DrawY := HG
                         else DrawY := (SegmentSpaceY div 2) + HG;
                       DrawHorizontalSegment(DrawX,DrawY,-(HW),HH,SColor);
                     end;
                8: begin
                     { Colon }
                     Inc(DrawX,(SegmentSpaceX - (VW div 3)) div 2);
                     DrawColon(DrawX,(SegmentSpaceY div 2)-((HH div 3) * 2),
                                 DrawX,(SegmentSpaceY div 2)+(HH div 3),
                                 (VW div 3),(HH div 3),SColor);
                   end;
              end;
            end;
          { Now we wait for the rest of the delay to complete if there is
            an animation }
          if (Animation <> 0) and (Speed>0) then
            begin
             { Draw what we've achieved so far if double buffering }
             if fDoBuffer then
               Canvas.CopyRect(ClientRect,fWorkCanvas,ClientRect);
             { Delay & process messages up until last segment }
             if AnimationCount < 8 then
             begin
               SegmentDelay:= Speed - DelayCorrection;
               repeat
                 { Process messages if not in design mode }
                 if not (csDesigning in ComponentState) then
                   Application.ProcessMessages;
                 DelayTicks := GetTickCount - FirstSegmentTickCount;
               until DelayTicks >= SegmentDelay;
               { Trim back delay speed to compensate for over long delays }
               DelayCorrection := DelayTicks-SegmentDelay;
               if DelayCorrection > Speed then
                  DelayCorrection := Speed;
              end;
            end
        until AnimationCount = 8;
      end;
    end;procedure SplitValue(AValue: String; var Value, Dots: String);
    var
      Count: Integer;
      Dot: Boolean;
    begin
      Count := 1;
      Value := '';
      Dots := '';
      Dot := False;
      while Count <= length(AValue) do
      begin
        if AValue[Count] <> '.' then
        begin
          if not Dot then
            Dots := Dots + ' '
          else
            Dot := False;
          Value := Value + AValue[Count];
        end
        else
        begin
          Dots := Dots + '.';
          if Dot then
            Value := Value + ' '
          else
            Dot := True;
        end;
        Inc(Count);
      end;
    end;
      

  6.   

    begin
      { Exit if the control is already painting }
      if fIsPainting then Exit;
      { Set the painting flag }
      fIsPainting := True;
      FirstTickCount := GetTickCount;
      PaintStart := GetTickCount;
      { Set working canvas to default; }
      fWorkCanvas := Canvas;
      { Get double buffer status }
      fDoBuffer := fDoubleBuffer;
      { Disable animation in design mode if preview off }
      if csDesigning in ComponentState then
        fIsChanging:=fPreview;
      { Attempt to create bitmap for double buffer if required }
      if fDoBuffer then
      begin
        try
          if fBufferBM = nil then
            fBufferBM := TBitMap.Create;
          { Set working canvas to bitmap }
          fWorkCanvas := fBufferBM.Canvas;
          { Set bitmap size to match client area }
          fBufferBM.Width := ClientWidth;
          fBufferBM.Height := ClientHeight;
        except
          { Set to normal draw if an error occurs }
          fBufferBM.Free;
          fBufferBM := nil;
          fDoBuffer := False;
          fWorkCanvas := Canvas;
        end;
      end;
      with fWorkCanvas do
      begin
        { Fill control background }
        Brush.Color := Color;
        Brush.Style := bsSolid;
        FillRect(ClientRect);
        { Select the animation to use }
        AnimationNo := 0;
        case fAnimation of
          anSpiral: AnimationNo := 1;
          anUp: AnimationNo := 2;
          anDown: AnimationNo := 3;
          anLeft: AnimationNo := 4;
          anRight: AnimationNo := 5;
          anRandom: AnimationNo := Random(5)+1;
        end;
        { Update the display.  Tmp is the used string, which is
          compared with tmp2 }
        if fValue = '' then
        begin
          { Clear the display }
          SplitValue('',tmp,tmp3);
          SplitValue(fOldValue,tmp2,tmp4);
          while length(tmp) < fDigitNum do tmp := ' ' + tmp;
          while length(tmp2) < fDigitNum do tmp2 := ' ' + tmp2;
          while length(tmp3) < fDigitNum do tmp3 := ' ' + tmp3;
          while length(tmp4) < fDigitNum do tmp4 := ' ' + tmp4;
          if fIsChanging then
             DrawDigit(AnimationNo,fAnimationDelay,False)
          else
              DrawDigit(0,0,False);
        end
        else
        begin
          { We start counting the whole delay here, as time can be wasted
            drawing the display.  A delay of 1000 MUST last around 1 second }
          { Here, we draw over the old value, but first we need
            to quickly redraw the old value incase the component
            is blank and is using an animation }
          SplitValue(fOldValue,tmp,tmp3);
          SplitValue('',tmp2,tmp4);
          while length(tmp) < fDigitNum do tmp := ' ' + tmp;
          while length(tmp2) < fDigitNum do tmp2 := ' ' + tmp2;
          while length(tmp3) < fDigitNum do tmp3 := ' ' + tmp3;
          while length(tmp4) < fDigitNum do tmp4 := ' ' + tmp4;
          DrawDigit(0,0,False);
          { Now draw the new value }
          SplitValue(fValue,tmp,tmp3);
          SplitValue(fOldValue,tmp2,tmp4);
          while length(tmp) < fDigitNum do tmp := ' ' + tmp;
          while length(tmp2) < fDigitNum do tmp2 := ' ' + tmp2;
          while length(tmp3) < fDigitNum do tmp3 := ' ' + tmp3;
          while length(tmp4) < fDigitNum do tmp4 := ' ' + tmp4;
          { Here we see how much delay time is left }
          tmpDelay := fAnimationDelay - Integer(GetTickCount-FirstTickCount);
          if tmpDelay < 0 then tmpDelay := 0;
          if fIsChanging then
            DrawDigit(AnimationNo,tmpDelay,True)
          else
            DrawDigit(0,0,True);
        end;
        { Store the value that we just used }
        if fValue = '' then fOldValue := '' else
          fOldValue := fValue;
      end;
      { Copy from buffer to screen & free memory if double buffering }
      if fDoBuffer then
      begin
         Canvas.CopyRect(ClientRect,fWorkCanvas,ClientRect);
         { Get rid of bitmap }
         fBufferBM.Free;
         fBufferBM := nil;
      end;
      { Disable animation }
      fIsChanging:=false;
      { Allow drawing }
      fIsPainting:=false;
      { Set paint duration value }
      fPaintDuration:=GetTickCount - PaintStart;
    end;procedure Register;
    begin
      RegisterComponents('Michael', [TLCD99]);
    end;end.