Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+
Verfasst: 06.11.2011 20:16
Bitte und danke für die schnellen Bug-Fixes.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
Changes/Änderungen:
- Added import libraries for gdiplus.dll (gdiplus_x86.lib & gdiplus_x64.lib)
-> the import libraries are used now by Default!
To use the old way with OpenLibrary(), declare the constant
#gDrawing_NO_DLL_IMPORT=1 before XIncludeFile "gDrawing.pbi"
- Added example19.pb, draw on screen
- Fixed text drawing problem with font offset (reported by Stargate)
- Fixed some small 64bit problems
- removed #PB_Font_Default constant for PB4.60
Meintest Du als Beispiel mit 2 Linien als Path:STARGÅTE hat geschrieben:ich bin gerade auf der Suche nach einer Funktion, mit der ich das Verhalten eines Pfades an den Ecken beeinflussen kann.
Damit meine ich, dass es zwar mit gSetPenCaps() Anfang und Ende definieren kann (rund, eckig, ...) aber irgendwie nicht wie es mittig aussehen soll.
Ich habe nämlich gerade einen Pfad, wo ich sehr spitze Winkel habe, und dort möchte ich keine spitzen Ecken haben, sonden abgeflachte oder runde.
Code: Alles auswählen
gDrawingMode(#PB_2DDrawing_Path)
gLineXY(10,10,35,300)
gLineXY(35,300,60,10)
gDrawingMode(#PB_2DDrawing_Outlined)
gSetPenSize(9)
gDrawPath(#PB_Default,RGBA($00,$00,$00,$FF))
Code: Alles auswählen
gDrawing v0.84, 15. Jan. 2012
- added commands
gSetPenLineJoin( lineJoin.l )
set line join mode, requested by Stargate
mode is one of the following constants:
#PenLineJoinMiter (default)
#PenLineJoinBevel
#PenLineJoinRound
#PenLineJoinMiterClipped
gSetPenMiterLimit( miterLimit.f )
set miter limit for line joins
gGetFontList( List fontList.s() )
get GDI+ font list (font family names)
gDrawRotatedFormattedText( x.f, y.f, width.f, height.f, Text$, angle.f [, color.q] )
draw rotated formatted text, see gDrawFormattedText()
gDrawFormattedText( x.f, y.f, width.f, height.f, Text$ [, color.q] )
draw formatted text into the rectangle specified by "x,y,width,height"
use gSetDrawTextFlags() to set the flags for formatting
gSetDrawTextFlags( flags.l )
set the formatting options for gDrawFormattedText()
flags is a combination of the following constants:
#DrawTextFullLinesOnly - draws last line on bottom only if fully visible
#DrawTextMeasureTrailingSpaces - include trailing spaces in measurement for text alignment
#DrawTextNoWordWrap - no automatic wordwrap at line end
#DrawTextNoHotkey - no hotkey (ampersand) processing
#DrawTextShowHotkey - process ampersand '&' and underline the next char.
to display an ampersand, use it 2 times: &&
#DrawTextHideHotkey - process ampersand '&' but do not display underlined chars.
to display an ampersand, use it 2 times: &&
the following group defines how text on each line
is aligned horizontally.
you can only use 1 constant out of this group:
#DrawTextLeftAligned - text is horizontally left aligned
#DrawTextCentered - text is horizontally centered
#DrawTextRightAligned - text is horizontally right aligned
the following group defines how text lines
are aligned vertically.
you can only use 1 constant out of this group:
#DrawTextLineTopAligned - text lines are vertically top aligned
#DrawTextLineCentered - text lines are vertically center aligned
#DrawTextLineBottomAligned - text lines are vertically bottom aligned
the following group defines how text is cut/trimmed at the end
if the text does not fit in the rectangle specified by gDrawFormattedText().
you can only use 1 constant out of this group:
#DrawTextNoTrimming - no trimming
#DrawTextCharacterTrimming - cut at character boundary
#DrawTextWordTrimming - cut at word boundary
#DrawTextEllipsisCharacterTrimming - cut at character boundary and display ellipsis '...'
#DrawTextEllipsisWordTrimming - cut at word boundary and display ellipsis '...'
#DrawTextEllipsisPathTrimming - cut in the center and display ellipsis '...'
(for example: "http://pure...com/forums")
- added examples
example 21 - test gSetPenLineJoin()
example 22 - quick test for gDrawFormattedText()
example 23 - shows continuous text (running text) with resizable window
example 24 - little font browser that displays the gGetFontList()
Ach quatsch, ich habe nur "zwischendurch" einen Funktionsplotter geschrieben, der u.a. sache wie Sin(1/x) sauber um x=0 darstellen soll (ohne dabei auch auf "geraden Strecken" unötige Pfadpunkte zu haben). Da nahe 0 die Schwingungen sehr schnell werden, sind die Extrema sehr spitz, was zu unschönnen Nebeneffekten geführt hat. Deswegen brauchte ich runde Ecken.Entschuldige bitte die Wartezeit auf v0.84, ich hoffe ich habe Dein Projekt nicht
zu lange aufgehalten.
Muss ich nochmal schauen, aber mir ist so aus dem Kopf nichts bekannt.STARGÅTE hat geschrieben:Gibt es da eine möglichkeit?