Autor Beitrag
gd0123456
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33



BeitragVerfasst: So 03.02.13 14:08 
Hi,

wieso wird die Schrift so verschwommen wenn ich mittels canvas.textout eine Ausgabe mache. Siehe Anhang.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
var

  p: Tpanel;
  i: timage;
begin

  p := tpanel.Create(nil);
  p.Parent := self;
  p.SetBounds(x,y,x1,y1);
  p.BorderStyle := bsnone;
  p.BevelKind := bkflat;
  p.Bevelouter := bvnone;
  p.BevelEdges := [];   

  p.BorderWidth := 0;
  p.Color := farbe;
  p.ShowCaption := true;
  p.Visible := true;

  i := timage.Create(nil);
  
  i.parent := p;
  i.Transparent := true;
  i.SetBounds(x,y,x1,y1);
  i.Visible := true;
  i.Canvas.Brush.Color := farbe;

  i.Canvas.Rectangle(x,y,x1,y1);
  i.Canvas.TextOut(x,y,'Dies ist nur ein Test mal schauen ob er funktioniert');

end;


Danke für die Hilfe

PS: Nachtrag: wenn ich die Farbe z.B. auf grüne stelle bei i.canvas.font dann wird die schrift scharf dargestellt, jedoch bei schwarz nicht


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 03.02.2013 um 13:50
Einloggen, um Attachments anzusehen!
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: So 03.02.13 14:51 
Moin!

Das könnte Suche bei Google CLEARTYPE sein, schalte das mal im OS ab und teste nochmal. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: So 03.02.13 14:51 
Mal abgesehen von den Speicherlecks: wie ist es, wenn Du direkt auf das Panel zeichnest? Du musst dazu nur die Canvas-Eigenschaft öffentlich machen.
gd0123456 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33



BeitragVerfasst: So 03.02.13 15:30 
Ähm, sry aber wie soll das gehen direkt auf das Panel zeichnen? TPanel hat ja keine canvas Eigenschaften womit ich darauf zeichnen könnte. Verstehe gerade gar nichts.

die Variablen sind alle öffentlich. Nur hier im Beispiel nicht. Sry. Komischerweise funktioniert es mit der Farbe Grün Rot etc.. nur mit Schwarz eben nicht.

Moderiert von user profile iconNarses: Beiträge zusammengefasst

Also hab es mal ausgeschalten, naja die Farbe Schwarz Hellgrau dargstellt, aber dafür scharf lol. also auch nicht ganz die Lösung


user profile iconNarses hat folgendes geschrieben Zum zitierten Posting springen:
Moin!

Das könnte Suche bei Google CLEARTYPE sein, schalte das mal im OS ab und teste nochmal. :idea:

cu
Narses
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: So 03.02.13 15:35 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
type
  TPanel = class(ExtCtrls.TPanel)
  private
    FOnPaint: TNotifyEvent;
  protected
    procedure Paint; override;
  public
    property Canvas;
  published
    property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
  end;

  TForm1 = class(TForm)
    Panel1: TPanel;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

...

implementation

{ TPanel }

procedure TPanel.Paint;
begin
  inherited;
  if Assigned(FOnPaint) then
    FOnPaint(self);
end;

Schon kannst Du ein OnPaint-Ereignis für ein Panel zuweisen und dort auf dessen Canvas herumzeichnen.