Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#5

AW: DrawText gestretcht

  Alt 22. Sep 2013, 15:37
DirectX DrawText oder GDI? Und was genau verstehst du unter gestrechter Scene?

Wenns um DirectX geht, wirst du da meiner Erfahrung nach mit einfachen Mitteln keinen Erfolg haben. Eventuell könnte es über Offscreen Surface Rendering funktionieren.
Zitat:
Gestretchter scene
Ein in einer Auflösung <> Viewport gestretchtes Bitmap mit StretchBlt
Drawtext GDI

Delphi-Quellcode:
procedure TBASSSoVis.OutlinedDrawText(Canvas: TCanvas; r: TRect;
  const Text: string; OutlineColor: TColor);
var
  OldBrushStyle: TBrushStyle;
  OldFontColor : TColor;

begin
   with Canvas do
   begin
      Lock;
      OldFontColor := Font.Color;
      Font.Color := OutlineColor;
      OldBrushStyle := Brush.Style;
      Brush.Style := bsClear;
      Font.Color := OldFontColor;
    DrawText(Canvas.Handle, PWideChar(Text),
             Length(PChar(Text)), r, DT_BOTTOM or DT_END_ELLIPSIS);
      Brush.Style := OldBrushStyle;
      Unlock;
   end;

end;
gruss
  Mit Zitat antworten Zitat