AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Text mit Zeilenumbruch auf Bitmap ausgeben

Ein Thema von SirThornberry · begonnen am 16. Okt 2003 · letzter Beitrag vom 16. Okt 2003
Antwort Antwort
Benutzerbild von SirThornberry
SirThornberry
(Moderator)

Registriert seit: 23. Sep 2003
Ort: Bockwen
12.235 Beiträge
 
Delphi 2006 Professional
 
#1

Text mit Zeilenumbruch auf Bitmap ausgeben

  Alt 16. Okt 2003, 09:00
Ich will auf einer Bitmap Text ausgeben, das problem jetzt ist wenn der Text zu lang ist das er nicht umgebrochen wird. Wenn ich in den String den ich dann mit canvas.textout so
'text'#13#10'zeile2'
definiere gibt er mit die sonderzeischen (13 und 10) als Viereck aus also geht auch das nicht. Wie könnte man das machen???
Jens
Mit Source ist es wie mit Kunst - Hauptsache der Künstler versteht's
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Text mit Zeilenumbruch auf Bitmap ausgeben

  Alt 16. Okt 2003, 09:14
Von Hand umbrechen oder die API DrawText nehmen mit dem Flag DT_WORDBREAK:
Zitat von PSDK:
Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line.
If this is not specified, output is on one line.
kombiniert mit DT_CALCRECT.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Gollum
Gollum

Registriert seit: 14. Jan 2003
Ort: Boxberg
456 Beiträge
 
Delphi 10.1 Berlin Professional
 
#3

Re: Text mit Zeilenumbruch auf Bitmap ausgeben

  Alt 16. Okt 2003, 09:26
Hallo,

anstatt DT_CALCRECT würde ich DT_WORDBREAK benutzen.

Zitat:
...
DT_CALCRECT
Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.
...
DT_WORDBREAK
Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-linefeed sequence also breaks the line.
...
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#4

Re: Text mit Zeilenumbruch auf Bitmap ausgeben

  Alt 16. Okt 2003, 09:35
Les mal genau, was ich geschrieben habe. Eventuell muß man es kombinieren.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Gollum
Gollum

Registriert seit: 14. Jan 2003
Ort: Boxberg
456 Beiträge
 
Delphi 10.1 Berlin Professional
 
#5

Re: Text mit Zeilenumbruch auf Bitmap ausgeben

  Alt 16. Okt 2003, 10:10
Hallo,

wer lesen kann, ist klar im Vorteil

DT_CALCRECT wird im Zusammenhang mit DT_WORDBREAK prinzipiell nicht benötigt. Interessant wird es nur, wenn ich meine Ausgabehöhe (z.B. eine Zelle in einem Grid) vergrößern muss, um sicherzustellen, dass der Text auch komplett angezeigt wird.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:15 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz