HSG

Aktuelle Seite: HSG/Fächer/Informatik/Material

Antialiasing


Download des Projekts: AntiAliasing.zip

unit uAnalogUhr2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,uTUhr2, ExtCtrls;

type
  TForm2 = class(TForm)
    eH: TEdit; eMin: TEdit; eSec: TEdit; L1: TLabel; L2: TLabel;
    bSetzen: TButton; lAusgabe: TLabel; IUhr: TImage;
    procedure bAuslesenClick(Sender: TObject);
    procedure bSetzenClick(Sender: TObject);
    procedure bIncSecClick(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    b1,b2 : TBitmap;
  public
    procedure aktualisiereAusgabe;
  end;

var
  Form2: TForm2;

implementation
{$R *.DFM}

procedure zeichneUhr;
var
  mx,my,r,ax,ay,ex,ey : word;
  i,h,min,sec         : byte;
  wh,wmin,wsec        : real;
  P1,P2,P3            : PByteArray;
  x,y                 : integer;

  procedure Uhr2Winkel(h,min,sec : byte; var wh,wmin,wsec : real);
  begin
    h := h mod 12; // 24h-Anzeige --> 12h-Anzeige
    wh   := pi/2 - 2*pi/12/60*(60*h+min);
    wmin := pi/2 - 2*pi/60*min;
    wsec := pi/2 - 2*pi/60*sec;
  end;

begin
  mx := Form2.b1.Width div 2; my := Form2.b1.Height div 2;
  if mx