Ir para conteúdo
Fórum Script Brasil
  • 0

Componente LCDNumber


Thales Pontes Martins

Pergunta

Sabem aquele componente LCDNumber que só existia na biblioteca CLX, bom agora existe na VCL também.

O componente LCDNumber é um componente visual que serve para mostrar datas, horas, temperaturas, etc...

Programa exemplo -> Relógio despertador

Listagem da unit do componente ULCDNumber.pas ->

unit ULCDNumber;
{
Componente LCDNumber
Autor: Thales Pontes Martins
thalespo@gmail.com.br
Dezembro de 2006
}
interface

uses
  SysUtils, Classes, Controls, ULCDData, Windows, Dialogs, Graphics, Forms, ExtCtrls;

type
  TBevelShape = (bsSingle, bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine,
    bsRightLine, bsSpacer);
  TDrawProc = procedure(Canvas : TCanvas; var Temp : TTempDigit);
  TLCDNumber = class(TGraphicControl)
  private
    { Private declarations }
    //******Bevel*****
    FStyle: TBevelStyle;
    FShape: TBevelShape;
    //******Bevel*****
    _TempDigit : TTempDigit;
    _Value : string;
    _ValAspect, _SizeAspect, _TextHeight, _TextWidth : double;
    _LastChange : integer;
    _PenColor, _BrushColor, _Color : TColor;
    procedure SetStyle(Value: TBevelStyle);
    procedure SetShape(Value: TBevelShape);    
    //******Bevel*****
    procedure UpdateTemp(Index : integer);
    procedure DrawDigit(index : integer; NewC, OldC: Char; DrawAll : boolean);
    //******Bevel*****
  protected
    { Protected declarations }
    procedure Paint; override;
    procedure SetValue(Val : String);
    procedure SetPenColor(Val : TColor);
    procedure SetBrushColor(Val : TColor);
    procedure SetColor(Val : TColor);
  public
    { Public declarations }
    constructor Create(AOwner : TComponent); override;
    destructor Destroy; override;
  published
    { Published declarations }
    property Value : string read _Value write SetValue;
    property PenColor : TColor read _PenColor write SetPenColor default 0;
    property BrushColor : TColor read _BrushColor write SetBrushColor default 0;
    property Color : TColor read _Color write SetColor default ClBtnFace;
    property Align;
    property Anchors;
    property Constraints;
    property ParentShowHint;
    property Shape: TBevelShape read FShape write SetShape default bsBox;
    property ShowHint;
    property Style: TBevelStyle read FStyle write SetStyle default bsLowered;
    property Visible;
    property Width;
    property Height;
    property AlignWithMargins;
    property Left;
    property Top;
    property Cursor;
    property Hint;
    property HelpType;
    property HelpKeyword;
    property HelpContext;
    property Margins;
    property OnClick;
    property OnDblClick;
    property OnMouseDown;
    property OnMouseUp;
  end;
  procedure DrawPol1(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol2(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol3(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol4(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol5(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol6(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol7(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol8(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol9(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol10(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol11(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol12(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol13(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol14(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol15(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol16(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol17(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol18(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol19(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol20(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol21(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol22(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol23(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol24(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol25(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol26(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol27(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol28(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol29(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol30(Canvas : TCanvas; var Temp : TTempDigit);
  procedure DrawPol31(Canvas : TCanvas; var Temp : TTempDigit);
procedure Register;

implementation
const
  CharOff = 127;
  CharHi = 227;
  CharAspect = 1.7874015748031496062992125984252;
  DrawPol : array [0..30] of TDrawProc =
  (DrawPol1,DrawPol2,DrawPol3,DrawPol4,DrawPol5,DrawPol6,
  DrawPol7,DrawPol8,DrawPol9,DrawPol10,DrawPol11,DrawPol12,DrawPol13,DrawPol14,
  DrawPol15,DrawPol16,DrawPol17,DrawPol18,DrawPol19,DrawPol20,DrawPol21,
  DrawPol22,DrawPol23,DrawPol24,DrawPol25,DrawPol26,DrawPol27,DrawPol28,
  DrawPol29,DrawPol30,DrawPol31);
procedure Register;
begin
  RegisterComponents('Samples', [TLCDNumber]);
end;

function RoundFloatPoint(pt : TFloatPoint) : TPoint;
begin
  Result.X:=Round(pt.X);
  Result.Y:=Round(pt.Y);
end;

function RoundRect(rc : TFloatRect) : TRect;
begin
  Result.Top:=Round(rc.Top);
  Result.Bottom:=Round(rc.Bottom);
  Result.Left:=Round(rc.Left);
  Result.Right:=Round(rc.Right);
end;

constructor TLCDNumber.Create(AOwner : TComponent);
begin
  inherited Create(AOwner);
  //**********Bevel********
  ControlStyle := ControlStyle + [csReplicatable];
  FStyle := bsLowered;
  FShape := bsBox;
  Width := 50;
  Height := 50;
  //**********Bevel********
  _LastChange:=0;
  _Color:=ClBtnFace;
  Width:=127;
  Height:=227;
  _TempDigit.Master:=Self;
  Canvas.Pen.Width:=1;
  Canvas.Pen.Color:=0;
  Canvas.Brush.Color:=0;
end;

procedure TLCDNumber.UpdateTemp(Index : integer);
var
  i : integer;
begin
  _ValAspect:=length(_Value)/CharAspect;
  _SizeAspect:=Width/Height;
  if (_ValAspect < _SizeAspect) then
  begin
    _TextWidth:=Height/CharAspect;
    for I := Low(LCData) to High(LCData) do
    begin
      if ((i mod 2) = 0){That is X} then
      TTempData(_TempDigit)[i]:=Round((
      ((LCData[i]+(CharOff*(Index-1)))/CharOff)*_TextWidth)+
      ((width-((height/CharAspect)*length(_Value)))/2))
      else {That is Y}
      TTempData(_TempDigit)[i]:=Round(
      (LCData[i]/CharHi)*Height);
    end;
  end else
  begin
    _TextHeight:=Width/_ValAspect;
    for I := Low(LCData) to High(LCData) do
    begin
      if ((i mod 2) = 0){That is X} then
      TTempData(_TempDigit)[i]:=Round(
      ((LCData[i]+(CharOff*(Index-1)))/CharOff)*(Width/length(_Value)))
      else {That is Y}
      TTempData(_TempDigit)[i]:=Round((
      (LCData[i]/CharHi)*_TextHeight)+((Height-_TextHeight)/2));
    end;
  end;
end;

destructor TLCDNumber.Destroy;
begin
  inherited Destroy;
end;

procedure TLCDNumber.Paint;
//*****Bevel*****
const
  XorColor = $00FFD8CE;
var
  Color1, Color2: TColor;
  Temp: TColor;
//*****Bevel*****
  i : integer;
//*****Bevel*****
  procedure BevelRect(const R: TRect);
  begin
    with Canvas do
    begin
      Pen.Color := Color1;
      PolyLine([Point(R.Left, R.Bottom), Point(R.Left, R.Top),
        Point(R.Right, R.Top)]);
      Pen.Color := Color2;
      PolyLine([Point(R.Right, R.Top), Point(R.Right, R.Bottom),
        Point(R.Left, R.Bottom)]);
    end;
  end;

  procedure BevelLine(C: TColor; X1, Y1, X2, Y2: Integer);
  begin
    with Canvas do
    begin
      Pen.Color := C;
      MoveTo(X1, Y1);
      LineTo(X2, Y2);
    end;
  end;
//*****Bevel*****
begin
  if (_Color <> (Parent as TForm).Color) then
  begin
    Canvas.Brush.Color:=_Color;
    Canvas.Pen.Color:=_Color;
    Canvas.Rectangle(0,0,Width-1,Height-1);
    Canvas.Brush.Color:=_BrushColor;
    Canvas.Pen.Color:=_PenColor;
  end;
  //*****Bevel*****
  with Canvas do
  begin
    if (csDesigning in ComponentState) then
    begin
      if (FShape = bsSpacer) then
      begin
        Pen.Style := psDot;
        Pen.Mode := pmXor;
        Pen.Color := XorColor;
        Brush.Style := bsClear;
        Rectangle(0, 0, ClientWidth, ClientHeight);
        Exit;
      end
      else
      begin
        Pen.Style := psSolid;
        Pen.Mode  := pmCopy;
        Pen.Color := clBlack;
        Brush.Style := bsSolid;
      end;
    end;

    Pen.Width := 1;
    if (FShape = bsSingle) then
    begin
      Brush.Color:=0;
      Pen.Color:=0;
    end else
    if FStyle = bsLowered then
    begin
      Color1 := clBtnShadow;
      Color2 := clBtnHighlight;
    end else
    begin
      Color1 := clBtnHighlight;
      Color2 := clBtnShadow;
    end;

    case FShape of
      bsBox: BevelRect(Rect(0, 0, Width - 1, Height - 1));
      bsFrame:
        begin
          Temp := Color1;
          Color1 := Color2;
          BevelRect(Rect(1, 1, Width - 1, Height - 1));
          Color2 := Temp;
          Color1 := Temp;
          BevelRect(Rect(0, 0, Width - 2, Height - 2));
        end;
      bsTopLine:
        begin
          BevelLine(Color1, 0, 0, Width, 0);
          BevelLine(Color2, 0, 1, Width, 1);
        end;
      bsBottomLine:
        begin
          BevelLine(Color1, 0, Height - 2, Width, Height - 2);
          BevelLine(Color2, 0, Height - 1, Width, Height - 1);
        end;
      bsLeftLine:
        begin
          BevelLine(Color1, 0, 0, 0, Height);
          BevelLine(Color2, 1, 0, 1, Height);
        end;
      bsRightLine:
        begin
          BevelLine(Color1, Width - 2, 0, Width - 2, Height);
          BevelLine(Color2, Width - 1, 0, Width - 1, Height);
        end;
      bsSingle:
        begin
          Canvas.MoveTo(0,0);
          Canvas.LineTo(width-1,0);
          Canvas.LineTo(width-1,height-1);
          Canvas.LineTo(0,height-1);
          Canvas.LineTo(0,0);
        end;
    end;
  end;
  //*****Bevel*****
  Canvas.Pen.Color:=_PenColor;
  Canvas.Brush.Color:=_BrushColor;
  UpdateTemp(1);

  for I := 1 to length(_Value) do DrawDigit(i,_Value[i],#0,true);
end;

procedure TLCDNumber.DrawDigit(index : integer; NewC, OldC: Char; DrawAll : boolean);
var
  Old, New : Cardinal;
  i : integer;
begin
  if (index <> _LastChange) then UpdateTemp(index);
  Old:=GetCharInf(OldC);
  New:=GetCharInf(NewC);
  if DrawAll then
  begin
    for I := 0 to 30 do if GetBit(i,New) then DrawPol[i](Canvas,_TempDigit)
  end else
  begin
    Canvas.Brush.Color:=_Color;
    Canvas.Pen.Color:=_Color;
    for I := 0 to 30 do
    begin
      if not(GetBit(i,New)) then if GetBit(i,Old) then DrawPol[i](Canvas,_TempDigit);
    end;
    Canvas.Brush.Color:=BrushColor;
    Canvas.Pen.Color:=PenColor;
    for I := 0 to 30 do
    begin
      if (OldC in ['0'..'9']) then
      begin
        if GetBit(i,New) then if not(GetBit(i,Old)) then DrawPol[i](Canvas,_TempDigit);
      end else
      begin
        if GetBit(i,New) then DrawPol[i](Canvas,_TempDigit);
      end;
    end;
  end;
  _LastChange:=index;
end;

procedure TLCDNumber.SetValue(Val: string);
var
  i : integer;
begin
  if (Val <> _Value) then
  begin
    if not(Visible) then
    begin
      _Value:=Val;
      Exit;
    end;
    if (length(Val) <> length(_Value)) then
    begin
      _Value:=Val;
      Invalidate;
    end else
    begin
      for I := 1 to length(Val) do
      begin
        if (Val[i] <> _Value[i]) then DrawDigit(i,Val[i],_Value[i],false);
      end;
      _Value:=Val;
    end;
  end;
end;

procedure TLCDNumber.SetPenColor(Val: TColor);
begin
  if (_PenColor <> Val) then
  begin
    _PenColor:=Val;
    Canvas.Pen.Color:=Val;
    Invalidate;
  end;
end;

procedure TLCDNumber.SetBrushColor(Val: TColor);
begin
  if (_BrushColor <> Val) then
  begin
    _BrushColor:=Val;
    Canvas.Brush.Color:=Val;
    Invalidate;
  end;
end;

procedure TLCDNumber.SetColor(Val: TColor);
begin
  if (Val <> _Color) then
  begin
    _Color:=Val;
    Invalidate;
  end;
end;

//******Bevel******
procedure TLCDNumber.SetStyle(Value: TBevelStyle);
begin
  if Value <> FStyle then
  begin
    FStyle := Value;
    Invalidate;
  end;
end;

procedure TLCDNumber.SetShape(Value: TBevelShape);
begin
  if Value <> FShape then
  begin
    FShape := Value;
    Invalidate;
  end;
end;
//******Bevel******

procedure DrawPol1(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol1);
end;
procedure DrawPol2(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol2);
end;
procedure DrawPol3(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol3);
end;
procedure DrawPol4(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol4);
end;
procedure DrawPol5(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol5);
end;
procedure DrawPol6(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol6);
end;
procedure DrawPol7(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol7);
end;
procedure DrawPol8(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol8);
end;
procedure DrawPol9(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Pol9);
end;
procedure DrawPol10(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.K);
end;
procedure DrawPol11(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Asterix);
end;
procedure DrawPol12(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.OpenBrace);
end;
procedure DrawPol13(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.CloseBrace);
end;
procedure DrawPol14(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.OpenBrackets);
end;
procedure DrawPol15(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.CloseBrackets);
end;
procedure DrawPol16(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Bigger);
end;
procedure DrawPol17(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Smaller);
end;
procedure DrawPol18(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.EqualUp);
end;
procedure DrawPol19(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.EqualDown);
end;
procedure DrawPol20(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.OpenParentesis);
end;
procedure DrawPol21(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.CloseParentesis);
end;
procedure DrawPol22(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Plus);
end;
procedure DrawPol23(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.Slash);
end;
procedure DrawPol24(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.BackSlash);
end;
procedure DrawPol25(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Ellipse(Temp.PercentUp);
end;
procedure DrawPol26(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Ellipse(Temp.PercentDown);
end;
procedure DrawPol27(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Polygon(Temp.CommaTail);
  Canvas.Ellipse(Temp.CommaCircle);
end;
procedure DrawPol28(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Ellipse(Temp.Dot);
end;
procedure DrawPol29(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Ellipse(Temp.ColonSup);
end;
procedure DrawPol30(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Ellipse(Temp.ColonInf);
end;
procedure DrawPol31(Canvas : TCanvas; var Temp : TTempDigit);
begin
  Canvas.Pen.Width:=round(((Temp.Pol7[8].Y-Temp.Pol1[8].Y)/100)*10);
  if Canvas.Pen.Width < 1 then Canvas.Pen.Width:=1;
  Canvas.Brush.Color:=(Temp.Master as TLCDNumber).Color;
  Canvas.Ellipse(Temp.Degree);
  Canvas.Pen.Width:=1;
  Canvas.Brush.Color:=(Temp.Master as TLCDNumber).BrushColor;
end;
end.
Listagem da Unit ULCDData.pas ->
unit ULCDData;

interface

uses
  Types;

type

TFloatPoint = packed record
  X : double;
  Y : double;
end;

TFloatRect = packed record
  Top : double;
  Bottom : double;
  Left : double;
  Right : double;
end;

TTempData = array [0..576] of LongInt;
TLCData = array [0..575] of double;

PLCDDigit = ^TLCDDigit;
TLCDDigit = packed record
  Pol1 : array [1..12] of TFloatPoint;
  Pol2 : array [1..6] of TFloatPoint;
  Pol3 : array [1..13] of TFloatPoint;
  Pol4 : array [1..7] of TFloatPoint;
  Pol5 : array [1..6] of TFloatPoint;
  Pol6 : array [1..13] of TFloatPoint;
  Pol7 : array [1..12] of TFloatPoint;
  Pol8 : array [1..5] of TFloatPoint;
  Pol9 : array [1..5] of TFloatPoint;
  K : array [1..11] of TFloatPoint;
  Asterix : array [1..19] of TFloatPoint;
  OpenBrace : array [1..27] of TFloatPoint;
  CloseBrace : array [1..27] of TFloatPoint;
  OpenBrackets : array [1..9] of TFloatPoint;
  CloseBrackets : array [1..9] of TFloatPoint;
  Bigger : array [1..7] of TFloatPoint;
  Smaller : array [1..7] of TFloatPoint;
  EqualUp : array [1..5] of TFloatPoint;
  EqualDown : array [1..5] of TFloatPoint;
  OpenParentesis : array [1..15] of TFloatPoint;
  CloseParentesis : array [1..15] of TFloatPoint;
  Plus : array [1..13] of TFloatPoint;
  CommaTail : array[1..12] of TFloatPoint;
  Slash : array[1..7] of TFloatPoint;
  BackSlash : array[1..7] of TFloatPoint;
  PercentUp : TFloatRect;
  PercentDown : TFloatRect;
  CommaCircle : TFloatRect;
  Dot : TFloatRect;
  ColonSup : TFloatRect;
  ColonInf : TFloatRect;
  Degree : TFloatRect;
end;



TTempDigit = packed record
  Pol1 : array [1..12] of TPoint;
  Pol2 : array [1..6] of TPoint;
  Pol3 : array [1..13] of TPoint;
  Pol4 : array [1..7] of TPoint;
  Pol5 : array [1..6] of TPoint;
  Pol6 : array [1..13] of TPoint;
  Pol7 : array [1..12] of TPoint;
  Pol8 : array [1..5] of TPoint;
  Pol9 : array [1..5] of TPoint;
  K : array [1..11] of TPoint;
  Asterix : array [1..19] of TPoint;
  OpenBrace : array [1..27] of TPoint;
  CloseBrace : array [1..27] of TPoint;
  OpenBrackets : array [1..9] of TPoint;
  CloseBrackets : array [1..9] of TPoint;
  Bigger : array [1..7] of TPoint;
  Smaller : array [1..7] of TPoint;
  EqualUp : array [1..5] of TPoint;
  EqualDown : array [1..5] of TPoint;
  OpenParentesis : array [1..15] of TPoint;
  CloseParentesis : array [1..15] of TPoint;
  Plus : array [1..13] of TPoint;
  CommaTail : array[1..12] of TPoint;
  Slash : array[1..7] of TPoint;
  BackSlash : array[1..7] of TPoint;
  PercentUp : TRect;
  PercentDown : TRect;
  CommaCircle : TRect;
  Dot : TRect;
  ColonSup : TRect;
  ColonInf : TRect;
  Degree : TRect;
  Master : TObject;
end;



const
Glyphs : array [#32..#255] of Cardinal =(
$00000000,//          Dec = 32
$00000000,//    !     Dec = 33
$00000006,//    "     Dec = 34
$00000000,//    #     Dec = 35
$000001EB,//    $     Dec = 36
$03400000,//    %     Dec = 37
$00000000,//    &     Dec = 38
$40000000,//    '     Dec = 39
$00080000,//    (     Dec = 40
$00100000,//    )     Dec = 41
$00000400,//    *     Dec = 42
$00200000,//    +     Dec = 43
$04000000,//    ,     Dec = 44
$00000008,//    -     Dec = 45
$08000000,//    .     Dec = 46
$00400000,//    /     Dec = 47
$00000077,//    0     Dec = 48
$00000024,//    1     Dec = 49
$0000005D,//    2     Dec = 50
$0000006D,//    3     Dec = 51
$0000002E,//    4     Dec = 52
$0000006B,//    5     Dec = 53
$0000007B,//    6     Dec = 54
$00000025,//    7     Dec = 55
$0000007F,//    8     Dec = 56
$0000006F,//    9     Dec = 57
$30000000,//    :     Dec = 58
$00000000,//  ;     Dec = 59
$00010000,//    <     Dec = 60
$00060000,//    =     Dec = 61
$00008000,//    >     Dec = 62
$00000000,//    ?     Dec = 63
$00000000,//    @     Dec = 64
$0000003F,//    A     Dec = 65
$0000007A,//    B     Dec = 66
$00000053,//    C     Dec = 67
$0000007C,//    D     Dec = 68
$0000005B,//    E     Dec = 69
$0000001B,//    F     Dec = 70
$0000007B,//    G     Dec = 71
$0000003E,//    H     Dec = 72
$000001C1,//    I     Dec = 73
$00000064,//    J     Dec = 74
$00000212,//    K     Dec = 75
$00000052,//    L     Dec = 76
$000000B7,//    M     Dec = 77
$00800036,//    N     Dec = 78
$00000077,//    O     Dec = 79
$0000001F,//    P     Dec = 80
$00000177,//    Q     Dec = 81
$00000213,//    R     Dec = 82
$0000006B,//    S     Dec = 83
$00000181,//    T     Dec = 84
$00000076,//    U     Dec = 85
$00000106,//    V     Dec = 86
$00000176,//    W     Dec = 87
$00C00000,//    X     Dec = 88
$0000006E,//    Y     Dec = 89
$0020005D,//    Z     Dec = 90
$00002000,//    [     Dec = 91
$00800000,//    \     Dec = 92
$00004000,//    ]     Dec = 93
$00000000,//    ^     Dec = 94
$00000040,//    _     Dec = 95
$40000000,//    `     Dec = 96
$0000007D,//    a     Dec = 97
$0000007A,//    b     Dec = 98
$00000058,//    c     Dec = 99
$0000007C,//    d     Dec = 100
$0000005F,//    e     Dec = 101
$0000001B,//    f     Dec = 102
$0000006F,//    g     Dec = 103
$0000003A,//    h     Dec = 104
$10000100,//    i     Dec = 105
$00000064,//    j     Dec = 106
$00000212,//    k     Dec = 107
$00000024,//    l     Dec = 108
$00000138,//    m     Dec = 109
$00000038,//    n     Dec = 110
$00000078,//    o     Dec = 111
$0000001F,//    p     Dec = 112
$0000002F,//    q     Dec = 113
$00000018,//    r     Dec = 114
$0000006B,//    s     Dec = 115
$00000108,//    t     Dec = 116
$00000070,//    u     Dec = 117
$00000070,//    v     Dec = 118
$00000170,//    w     Dec = 119
$00C00000,//    x     Dec = 120
$0000006E,//    y     Dec = 121
$0020005D,//    z     Dec = 122
$00000800,//    {     Dec = 123
$00000180,//    |     Dec = 124
$00001000,//    }     Dec = 125
$00000000,//    ~     Dec = 126
$00000000,//         Dec = 127
$00000153,//    €     Dec = 128
$00000000,//         Dec = 129
$00000000,//    ‚     Dec = 130
$00000000,//    ƒ     Dec = 131
$00000000,//    „     Dec = 132
$00000000,//    …     Dec = 133
$00000000,//    †     Dec = 134
$20000058,//    ‡     Dec = 135
$00000000,//    ˆ     Dec = 136
$00000000,//    ‰     Dec = 137
$00000000,//    Š     Dec = 138
$00000000,//    ‹     Dec = 139
$00000000,//    Œ     Dec = 140
$00000000,//         Dec = 141
$00000000,//    Ž     Dec = 142
$00000000,//         Dec = 143
$00000000,//         Dec = 144
$00000000,//    ‘     Dec = 145
$00000000,//    ’     Dec = 146
$00000000,//    “     Dec = 147
$00000000,//    ”     Dec = 148
$00000000,//    •     Dec = 149
$00000000,//    –     Dec = 150
$00000000,//    —     Dec = 151
$00000000,//    ˜     Dec = 152
$00000000,//    ™     Dec = 153
$00000000,//    š     Dec = 154
$000001D3,//    ›     Dec = 155
$00000000,//    œ     Dec = 156
$00000000,//         Dec = 157
$00000000,//    ž     Dec = 158
$00000000,//    Ÿ     Dec = 159
$00000000,//          Dec = 160
$00000000,//    ¡     Dec = 161
$00000000,//    ¢     Dec = 162
$00000000,//    £     Dec = 163
$00000000,//    ¤     Dec = 164
$00000000,//    ¥     Dec = 165
$00000000,//    ¦     Dec = 166
$00000000,//    §     Dec = 167
$00000000,//    ¨     Dec = 168
$00000000,//    ©     Dec = 169
$00000000,//    ª     Dec = 170
$00000000,//    «     Dec = 171
$00000000,//    ¬     Dec = 172
$00000000,//    ­     Dec = 173
$00000000,//    ®     Dec = 174
$00000000,//    ¯     Dec = 175
$00000000,//    °     Dec = 176
$00000000,//    ±     Dec = 177
$00000000,//    ²     Dec = 178
$00000000,//    ³     Dec = 179
$00000000,//    ´     Dec = 180
$00000000,//    µ     Dec = 181
$00000000,//    ¶     Dec = 182
$00000000,//    ·     Dec = 183
$00000000,//    ¸     Dec = 184
$00000000,//    ¹     Dec = 185
$00000000,//    º     Dec = 186
$00000000,//    »     Dec = 187
$00000000,//    ¼     Dec = 188
$00000000,//    ½     Dec = 189
$00000000,//    ¾     Dec = 190
$00000000,//    ¿     Dec = 191
$00000000,//    À     Dec = 192
$00000000,//    Á     Dec = 193
$00000000,//    Â     Dec = 194
$00000000,//    Ã     Dec = 195
$00000000,//    Ä     Dec = 196
$00000000,//    Å     Dec = 197
$00000000,//    Æ     Dec = 198
$00000000,//    Ç     Dec = 199
$00000000,//    È     Dec = 200
$00000000,//    É     Dec = 201
$00000000,//    Ê     Dec = 202
$00000000,//    Ë     Dec = 203
$00000000,//    Ì     Dec = 204
$00000000,//    Í     Dec = 205
$00000000,//    Î     Dec = 206
$00000000,//    Ï     Dec = 207
$00000000,//    Ð     Dec = 208
$00000000,//    não     Dec = 209
$00000000,//    Ò     Dec = 210
$00000000,//    Ó     Dec = 211
$00000000,//    Ô     Dec = 212
$00000000,//    Õ     Dec = 213
$00000000,//    Ö     Dec = 214
$00000000,//    ×     Dec = 215
$00000000,//    Ø     Dec = 216
$00000000,//    Ù     Dec = 217
$00000000,//    Ú     Dec = 218
$000001FF,//    Û     Dec = 219
$00000178,//    Ü     Dec = 220
$00000192,//    Ý     Dec = 221
$000001A4,//    Þ     Dec = 222
$0000008F,//    ß     Dec = 223
$00000000,//    à     Dec = 224
$00000000,//    á     Dec = 225
$00000017,//    â     Dec = 226
$00000000,//    ã     Dec = 227
$00000000,//    ä     Dec = 228
$00000000,//    å     Dec = 229
$00000000,//    æ     Dec = 230
$00000000,//    ç     Dec = 231
$00000000,//    è     Dec = 232
$00000000,//    é     Dec = 233
$00000000,//    ê     Dec = 234
$00000000,//    ë     Dec = 235
$00000000,//    ì     Dec = 236
$00000000,//    í     Dec = 237
$00000000,//    î     Dec = 238
$00000000,//    ï     Dec = 239
$00000049,//    ð     Dec = 240
$00000000,//    não     Dec = 241
$00008040,//    ò     Dec = 242
$00010040,//    ó     Dec = 243
$00000000,//    ô     Dec = 244
$00000000,//    õ     Dec = 245
$30000008,//    ö     Dec = 246
$00000000,//    ÷     Dec = 247
$40000000,//    ø     Dec = 248
$20000000,//    ù     Dec = 249
$10000000,//    ú     Dec = 250
$00000000,//    û     Dec = 251
$00000007,//    ü     Dec = 252
$00000000,//    ý     Dec = 253
$00000100,//    þ     Dec = 254
$7FFFFFFF);//   ÿ     Dec = 255

LCData : TLCData =
//polygon1
(13.5000, 24.9115,
13.7656, 22.9833,
14.3831, 20.3263,
15.2475, 18.5653,
16.8528, 16.5880,
18.5507, 15.2741,
20.5264, 13.9619,
23.2739, 13.5000,
102.0885, 13.5000,
86.5000, 40.5000,
40.5000, 40.5000,
13.5000, 24.9115,

//Polygon2
13.5000,109.1324,
20.1000,113.5000,
40.5000,100.0000,
40.5000,40.5000,
13.5000,24.9115,
13.5000,109.1324,

//Polygon3
106.9000, 113.5000,
113.5000, 109.1324,
113.5000, 23.2739,
113.0381, 20.5264,
111.9259, 18.5507,
110.4120, 16.8528,
108.4347, 15.2475,
106.6737, 14.3831,
104.0167, 13.7656,
102.0885, 13.5000,
86.5000, 40.5000,
86.5000, 100.0000,
106.9000, 113.5000,

//polygon4
20.1000, 113.5000,
40.5000, 127.0000,
86.5000, 127.0000,
106.9000, 113.5000,
86.5000, 100.0000,
40.5000, 100.0000,
20.1000, 113.5000,


//Polygon5
13.5000, 202.0885,
40.5000, 186.5000,
40.5000, 127.0000,
20.1000, 113.5000,
13.5000, 117.8676,
13.5000, 202.0885,

//Polygon6
102.0885, 213.5000,
104.0167, 213.2344,
106.6737, 212.6169,
108.4347, 211.7525,
110.4120, 210.1472,
111.9259, 208.4493,
113.0381, 206.4736,
113.5000, 203.7261,
113.5000, 117.8676,
106.9000, 113.5000,
86.5000, 127.0000,
86.5000, 186.5000,
102.0885, 213.5000,

//polygon7
13.5000, 202.0885,
13.7656, 204.0167,
14.3831, 206.6737,
15.2475, 208.4347,
16.8528, 210.4120,
18.5507, 211.9259,
20.5264, 213.0381,
23.2739, 213.5000,
102.0885, 213.5000,
86.5000, 186.5000,
40.5000, 186.5000,
13.5000, 202.0885,

// Polygon8
52.0000, 100.0000,
75.0000, 100.0000,
75.0000, 40.5000,
52.0000, 40.5000,
52.0000, 100.0000,
// Polygon9
52.0000, 186.5000,
75.0000, 186.5000,
75.0000, 127.0000,
52.0000, 127.0000,
52.0000, 186.5000,


// K
113.5000, 199.3520, 
86.5000, 186.5000, 
40.5000, 127.0000,
20.1000, 113.5000,
40.5000, 100.0000, 
86.5000, 40.5000 , 
113.5000, 27.6480 , 
107.8607, 57.0142 , 
64.1910, 113.5000, 
107.8607, 169.9858, 
113.5000, 199.3520,
// asterix
53.5000, 177.3549, 
53.5000, 132.2788, 
13.5000, 159.1860, 
13.5000, 135.0821, 
45.5837, 113.5000, 
13.5000, 91.9179 , 
13.5000, 67.8140 , 
53.5000, 94.7212 , 
53.5000, 49.6451 , 
73.5000, 49.6451 , 
73.5000, 94.7212 , 
113.5000, 67.8140 , 
113.5000, 91.9179 , 
81.4163, 113.5000, 
113.5000, 135.0821, 
113.5000, 159.1860, 
73.5000, 132.2788, 
73.5000, 177.3549, 
53.5000, 177.3549,
// OpenBrace
105.8364, 213.5000,
94.6545, 213.5000,
73.2641, 208.6574,
55.3507, 195.8722,
45.1697, 177.4824,
45.1697, 127.0000,
21.1636, 113.5000,
45.1697, 100.0000,
45.1697, 49.5176 ,
55.3507, 31.1278 ,
73.2641, 18.3426 ,
94.6545, 13.5000 ,
105.8364, 13.5000 ,
105.8364, 40.1668 ,
99.1444, 40.1668 ,
84.5260, 43.4763 ,
76.0116, 49.5533 ,
72.1697, 56.4927 ,
72.1697, 100.0000,
53.5849, 113.5000,
72.1697, 127.0000,
72.1697, 170.5073,
76.0116, 177.4467,
84.5260, 183.5237,
99.1444, 186.8332,
105.8364, 186.8332,
105.8364, 213.5000,
// CIoseBrace
21.1636, 213.5000,
32.3455, 213.5000, 
53.7359, 208.6574, 
71.6493, 195.8722, 
81.8303, 177.4824, 
81.8303, 127.0000, 
105.8364, 113.5000, 
81.8303, 100.0000, 
81.8303, 49.5176 , 
71.6493, 31.1278 , 
53.7359, 18.3426 , 
32.3455, 13.5000 , 
21.1636, 13.5000 , 
21.1636, 40.1668 , 
27.8556, 40.1668 , 
42.4740, 43.4763 , 
50.9884, 49.5533 , 
54.8303, 56.4927 , 
54.8303, 100.0000, 
73.4151, 113.5000, 
54.8303, 127.0000, 
54.8303, 170.5073, 
50.9884, 177.4467, 
42.4740, 183.5237, 
27.8556, 186.8332, 
21.1636, 186.8332, 
21.1636, 213.5000,
// OpenBrackets
95.9223, 213.5000, 
31.0777, 213.5000, 
31.0777, 13.5000 , 
95.9223, 13.5000 , 
95.9223, 40.5000 , 
58.0777, 40.5000 , 
58.0777, 186.5000, 
95.9223, 186.5000, 
95.9223, 213.5000,
// CIoseBrackets
31.0777, 213.5000, 
95.9223, 213.5000, 
95.9223, 13.5000 , 
31.0777, 13.5000 , 
31.0777, 40.5000 , 
68.9223, 40.5000 , 
68.9223, 186.5000, 
31.0777, 186.5000, 
31.0777, 213.5000,
// Bigger
13.5000, 176.8454, 
113.5000, 113.5000, 
13.5000, 50.1546 , 
13.5000, 82.1158 , 
63.0445, 113.5000, 
13.5000, 144.8842, 
13.5000, 176.8454,
// Smaller
113.5000, 176.8454, 
13.5000, 113.5000, 
113.5000, 50.1546 , 
113.5000, 82.1158 , 
63.9555, 113.5000, 
113.5000, 144.8842, 
113.5000, 176.8454,
// Equal Up
13.5000, 100.0000, 
113.5000, 100.0000,
113.5000, 73.0000 , 
13.5000, 73.0000 , 
13.5000, 100.0000,
// Equal Down
13.5000, 127.0000,
13.5000, 154.0000,
113.5000, 154.0000,
113.5000, 127.0000,
13.5000, 127.0000,
// OpenParentesis
71.6250, 213.5000, 
53.4821, 183.8127, 
40.6806, 150.2537, 
37.2647, 113.5000, 
40.6806, 76.7463 , 
53.4821, 43.1873 , 
71.6250, 13.5000 , 
105.3750, 13.5000 , 
81.3439, 50.1889 , 
67.6233, 82.4253 , 
64.7353, 113.5000, 
67.6233, 144.5747, 
81.3439, 176.8111, 
105.3750, 213.5000, 
71.6250, 213.5000,
// CIoseParentesis
21.6250, 213.5000, 
55.3750, 213.5000, 
73.5179, 183.8127, 
86.3194, 150.2537, 
89.7353, 113.5000, 
86.3194, 76.7463 , 
73.5179, 43.1873 , 
55.3750, 13.5000 , 
21.6250, 13.5000 , 
45.6561, 50.1889 , 
59.3767, 82.4253 , 
62.2647, 113.5000, 
59.3767, 144.5747, 
45.6561, 176.8111, 
21.6250, 213.5000,

// Plus
50.0000, 163.5000,
50.0000, 127.0000,
13.5000, 127.0000,
13.5000, 100.0000,
50.0000, 100.0000,
50.0000, 63.5000 ,
77.0000, 63.5000 ,
77.0000, 100.0000,
113.5000, 100.0000,
113.5000, 127.0000,
77.0000, 127.0000,
77.0000, 163.5000,
50.0000, 163.5000,

//CommaTail:
27.6453, 177.1241,
53.9998, 173.0648,
53.9282, 187.9864,
50.5732, 197.7387,
45.4899, 205.5609,
37.7633, 211.6561,
24.9372, 216.9098,
28.1051, 210.2339,
30.2400, 203.0212,
31.3584, 195.7070,
31.3584, 188.6975,
27.6453, 177.1241,

// Slash
13.5000, 213.5000,
28.5935, 213.5000,
113.5000, 43.6869,
113.5000, 13.5000,
98.4065, 13.5000,
13.5000, 183.3131,
13.5000, 213.5000,
// BackSlash
98.4065, 213.5000,
113.5000, 213.5000,
113.5000, 183.3131,
28.5935,13.5000,
13.5000, 13.5000,
13.5000, 43.6869,
98.4065, 213.5000,



// Percent
// PercentUp
// Lel
13.5000,
28.5000 ,
53.5000,
68.5000 ,
// PercentDown
73.5000,
158.5000,
113.5000,
198.5000,

//Comma
//CircleRec:
//Ieft:
27.0000,
//top:
159.5000,
//right:
54.0000,
//bottom:
186.5000,



//dot:
//CircleRec:
//Ieft:
27.0000,
//top:
186.5000,
//right
54.0000,
//bottom:
213.5000,


//superiorCircleRec:
//Ieft:
50.0000,
//top:
56.7500,
//right:
77.0000,
//bottom:
83.7500,

//colon:
//inferiorCircleRec:
//Ieft:
50.0000,
//top:
143.2500,
//right:
77.0000,
//bottom:
170.2500,

// Degree
// Left
23.5000,
// Top
23.5000,
// Right
95.0000,
// Bottom
95.0000);


function GetBit(index: integer; val : Cardinal) : Boolean;
function GetCharInf(ch : char) : Cardinal;

implementation

function GetBit(index: integer; val : Cardinal) : Boolean;
begin
  Result:=((val and (1 shl index)) <> 0);
end;

function GetCharInf(ch : char) : Cardinal;
begin
  if (ch in [#32..#255]) then result:=Glyphs[ch] else result:=$00000000;
end;

end.

Editado por Thales Pontes Martins
Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,4k
×
×
  • Criar Novo...