Autor Beitrag
MrCoder
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65

WinXP, SuSE Linux
D7 Ent
BeitragVerfasst: Mo 07.06.04 15:46 
Hi Leutz,
ich hab da ein Problem:

Ich würde gern einen Bilschirmschoner mit OpenGL programmieren.
Ich wollte einen Text anzeigen (Schriftgröße etwa 100), aber
der Text verpixelt ziemlich stark.

Meine Frage: Lässt sich dieses Problem irgendwie lösen? (Anti-Aliasing)

Danke im Vorraus

MfG
Mr. Coder
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Mo 07.06.04 16:25 
Für antialiaste Schrift braucht Du aber nich OpenGl nehmen, wenn Du nich andere Gründe dafür hast. Da würde ich persönlich GDI+ nehmen. Musst mal Suche bei Google GDIPLUS DELPHI googlen.

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
MrCoder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65

WinXP, SuSE Linux
D7 Ent
BeitragVerfasst: Mo 07.06.04 19:20 
Titel: Code?
Wär es denn nicht möglich das auch in OpenGL zu machen?
Das wäre mir lieber :wink:

oder einen Beispielcode mit GDI+ :)

MfG,
Mr. Coder
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Di 08.06.04 01:47 
Hi,

na ja... so pauschal lässt sich das nicht sagen ;)

Du zeichnest mit OpenGL Text, ja... aber.. wie genau??? *g*

Wenn du z.B. einfach die Windows Fonts als 2D Text benutzt ist es verpixelt, jep... gibt aber da mehrere möglichkeiten wie du's mgehen kannst:

1.) Nimm keine Windows Fonts, sondern mach dir ne eigene BitmapFont *g*
2.) Wenn du doch Winfonts willst, mach sie einfach mit Schriftgröße 200 und skaliere sie auf 0.5 runter, dadurch sollte OpenGL das ganze automatisch "weichzeichnen".. :)

Ansonsten beschreib mal genauer auf welche art und weise du den Text darstellst.

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Di 08.06.04 09:40 
Dieser Beispiel-Code hier ist bei GDIPlus für Delphi dabei:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var
  graphics : TGPGraphics;
  Font: TGPFont;
  SolidBrush: TGPBrush;
begin
  graphics   := TGPGraphics.Create(DC);
  Font       := TGPFont.Create('Times New Roman', 32, FontStyleRegular);
  SolidBrush := TGPSolidBrush.Create(MakeColor(175, 0, 0, 255));

  graphics.SetTextRenderingHint(TextRenderingHintSingleBitPerPixel);
  graphics.DrawString('SingleBitPerPixel', -1, font, MakePoint(10.0, 10.0), solidBrush);

  graphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
  graphics.DrawString('AntiAlias', -1, font, MakePoint(10.0, 60.0), solidBrush);

  graphics.Free;
  Font.Free;
  SolidBrush.Free;
end;


Das schöne ist, daß man hier beispielsweise ganz einfach auch andere Brush-Typen benutzen kann. Zum Beispiel gibt´s ne Klasse TGPTextureBrush womit Du dann Deinem Text ne Texture geben kannst etc. Schön ist auch, daß die Farbe des Brushs von vornherein transparent sein kann (der erste Parameter von MAKECOLOR ist die Deckkraft).

Mit OpenGL kenn ich mich überhaupt nicht aus. Da kann ich nicht helfen.

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
MrCoder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65

WinXP, SuSE Linux
D7 Ent
BeitragVerfasst: Di 08.06.04 15:20 
Titel: Scaneffekt?
Hallo,
jo danke Leute das hat mich jetzt schon mal ein Stück weitergebracht.
Eigentlich wollte ich auch einen Scaneffekt in den Bildschirmschoner einbauen.
Wisst Ihr, wie dieses Aufhellen geht (GDIPlus oder OpenGL) ???
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Di 08.06.04 16:10 
Welches Aufhellen? Meinst Du denn Effekt, wenn man mit einer Kamera einen Bildschirm filmt und dort immer dieser helle Streifen runterfährt? Falls ja, würde ich das mit einem transparenten PNG machen. GDIPlus kann problemlos PNGs laden. Dann brauchst Du das Bild immer nur über den Rest drüberzeichnen.
Also falls Du´s mit GDI+ machen willst, nä?

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Di 08.06.04 16:12 
mit OpenGL einfach ein bildschirmfüllendes Quad mit einem Alphawert <1 drüberzeichnen...
(blending muss natürlich aktiviert sein... :D)
iGoA
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 103

Alle Win´s
D5 Prof
BeitragVerfasst: Di 08.06.04 16:22 
Oder so! :D Wenn man weiß, wie... :wink:

_________________
"Diner for One" objektorientiert:
"The same method as last year, Ms. Sophie?" (was für´n Schwachsinn)