Einzelnen Beitrag anzeigen

myicq

Registriert seit: 5. Jan 2016
70 Beiträge
 
Delphi 6 Professional
 
#1

GR32 - Drawtext rotiert, und Unicode

  Alt 24. Sep 2018, 11:03
Hallo alle

ich habe angefangen die Füße in GR32 naß zu machen. So weit eigentlich iO.

Ich habe die Demos durchgegangen, alles einfach zu verstehen.

Leider bin ich auf ein Stein gestoßen: Gedrehter Text als Widestring:

Sehe mein Beispiel: ich habe eine TNTUnicodeEdit, und zeichne mein Text mit sowohl SimpleText als TText32.draw.

Ergebniss: mit "normal" geht alles wie im Demo, wie gewollt.
Mit Chinesish wird offenbar das TText32.DrawText die Bytes einzeln ausgibt.

Frage: wie erreiche ich die Kombination:

- Delphi 6 (oder 7)
- UnicodeText
- Gedrehter Ausgabe

kann sein das GR32 doch nicht hier das beste Tool ist. Oder wurde Text32.draw() später für unicodeStrings korrigiert ?

Danke an alle Inputs.

Mein Code:
Delphi-Quellcode:
procedure TForm1.tntbtbtn1Click(Sender: TObject);
  var
    cl : TColor32;
    r1: TFloatRect;
      text32: TText32;
    thefont : TTrueTypeFont;
      x1, y1: integer;
      myfont: TFont;
begin
  img32.SetupBitmap( true, clwhite32 );

  thefont := TrueTypeFontClass.Create('Arial', randomrange(20,50));
  myfont := tfont.Create;
  myfont.Size := 32;
  myfont.Name := 'Arial Unicode MS';


       x1 := RandomRange (0, img32.Width div 2);
     y1 := randomrange(0, img32.Height div 2);

  // das geht gut:
        SimpleText(img32.Bitmap,
                myfont,
                x1,y1,
                'SimpleText: ' + tntedt1.Text,
                clBlack32);

      cl := clBlack32;
      text32 := ttext32.Create;

   // --------- Geht NICHT
   //
  with text32 do
       try
              Angle := 15;
              // procedure TText32.Draw(bitmap: TBitmap32; X, Y: single; const text: widestring; ttFont: TTrueTypeFont; color: TColor32);


              draw (
                   img32.Bitmap,
                   x1,y1,
                   'text32.draw: ' + tntedt1.text,
                   thefont,
                   clblack32
                );
        finally
            free;
        end;

       img32.Bitmap.EndUpdate;
end;
Miniaturansicht angehängter Grafiken
2018-09-24_114413.jpg   2018-09-24_114448.jpg  
  Mit Zitat antworten Zitat