![]() |
Logarithmische Skalen
Liste der Anhänge anzeigen (Anzahl: 2)
Hallo,
ich stehe (wie immer:wink:) etwas auf dem Schlauch. Ich möchte eine analoge VU-Meter Komponente entwickeln und komme mit der logarithmischen Skale nicht weiter. Als Basis für die Berechnung beziehe ich micht auf ![]() Nur das Ergebniss ist nicht so wie erwartet:( Für die Darstellung der logarithmischen Skale verwender ich folgende Procedure
Delphi-Quellcode:
Wie man in der angehängten Grafik unschwer erkennen kann, sind 100% nicht 100% und ich weiß nicht warum:evil:.... procedure PainLogScale(aRect : TRect; aMax : Integer); var I, L, X : Integer; U, V: Extended; Str : String; begin with Canvas do begin FLineWidth := aRect.Right - aRect.Left; L := aRect.Left; I := 0; while I <= (aMax div 10) do begin MoveTo(L, aRect.Bottom); LineTo(L, aRect.Bottom - 10); Str := Format('%d', [Round(I*10)]); X := L - (TextWidth(Str) div 2); if (I = 0) or (I > 1) then TextOut(X, aRect.Bottom - (TextHeight('Wy') + 10), Str); Inc(I); U := Log10(I); V := FLineWidth * U; DoLogEvent(X, U, V); L := Trunc(V); end; end; end; ... Die Demo zum Scrennshot liegt bei. Hat jemand einen Tipp? |
AW: Logarithmische Skalen
Delphi-Quellcode:
L := Trunc(V) + aRect.Left;
|
AW: Logarithmische Skalen
:angel:
DANKE :cheers: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:48 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz