Einzelnen Beitrag anzeigen

Benutzerbild von xZise
xZise

Registriert seit: 3. Mär 2006
Ort: Waldbronn
4.303 Beiträge
 
Delphi 2009 Professional
 
#3

Re: [Image.Canvas.TextOut] €-Zeichen "malen"

  Alt 31. Jul 2006, 16:31
Delphi-Quellcode:
const MONEY: array[1..26] of Extended = (0.01, 0.20, 0.50, 1, 5, 10, 20, 50, 100, 200, 300, 400, 500,
                                   1000, 2500, 5000, 7500, 10000, 12500, 15000, 20000, 25000,
                                   50000, 100000, 150000, 250000);

procedure TfMain.bNewGameClick(Sender: TObject);
var
  i, rnd : Integer;
  BM_MoneyNum : array [1..26] of Byte;
  Nums : TNumsArray;
begin
  if not Running then begin
{...}
    LeftMoney.Canvas.Brush.Style := bsClear;
    LeftMoney.Canvas.Font.Name := 'BN Machine';
    LeftMoney.Canvas.Font.Height := 16;
    RightMoney.Canvas.Brush.Style := bsClear;
    RightMoney.Canvas.Font.Name := 'BN Machine';
    RightMoney.Canvas.Font.Height := 16;
    for i := 0 to 12 do begin
      LeftMoney.Canvas.Draw(0, i * 21 + i * 3, Plakette_0.Picture.Graphic);
      LeftMoney.Canvas.TextOut((LeftMoney.Width - LeftMoney.Canvas.TextWidth(FloatToStr(MONEY[i + 1]) + '')) div 2, i * 24 + 5, FloatToStr(MONEY[i + 1]) + '');
      LeftMoney.Repaint;
      RightMoney.Canvas.Draw(0, i * 21 + i * 3, Plakette_0.Picture.Graphic);
      RightMoney.Canvas.TextOut((RightMoney.Width - RightMoney.Canvas.TextWidth(FloatToStr(MONEY[i + 14]) + '')) div 2, i * 24 + 5, FloatToStr(MONEY[i + 14]) + '');
      RightMoney.Repaint;
      Sleep(100);
    end;
{...}
end;
Fabian
Eigentlich hat MS Windows ab Vista den Hang zur Selbstzerstörung abgewöhnt – mkinzler
  Mit Zitat antworten Zitat