Seite 10 von 12

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 06.11.2011 20:16
von STARGÅTE
Bitte und danke für die schnellen Bug-Fixes.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 13.11.2011 10:55
von Danilo
Update v0.83

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
DOWNLOAD: gDrawing_v0.83.zip oder gDrawing_v0.83.zip (75k)

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 13.11.2011 17:54
von Danilo
Bild

DOWNLOAD: example20_CanvasGadget.zip (98,3k) - (benötigt gDrawing_v0.83.zip)

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 13.01.2012 21:03
von STARGÅTE
Hallo Danilo,

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.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 14.01.2012 11:42
von Danilo
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.
Meintest Du als Beispiel mit 2 Linien als Path:

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))
Dort möchtest Du den spitzen Winkel weg haben, oder wie meinst Du das genau
mit "aber irgendwie nicht wie es mittig aussehen soll"?

Bild

Wenn es nur das ist, dann kein Problem. Habe ich gerade eingebaut, muß aber
nochmal checken und mache vielleicht noch paar Dinge von der ToDo-Liste dazu.

PS: Ich merke gerade, das funktioniert nur im Outline Modus, nicht mit gefülltem Path.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 14.01.2012 13:04
von STARGÅTE
Jo, genau, das meinte ich, danke, dann warte ich mal.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 15.01.2012 23:00
von Danilo
Entschuldige bitte die Wartezeit auf v0.84, ich hoffe ich habe Dein Projekt nicht
zu lange aufgehalten.

DOWNLOAD: gDrawing_v0.84.zip oder gDrawing_v0.84.zip (83k)

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()
Bild

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 16.01.2012 01:10
von STARGÅTE
Entschuldige bitte die Wartezeit auf v0.84, ich hoffe ich habe Dein Projekt nicht
zu lange aufgehalten.
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.

An dieser Stelle wieder mal Danke, für das neue Update.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 09.02.2012 00:50
von STARGÅTE
Hallo Danilo,

habe gerade das neue gDrawFormattedText entdeckt und dachte es könnte mein "eigene" Umbruch-Prozeduren ersetzen.
Leider musste ich jedoch feststellen, dass zwar gDrawFormattedText richtig arbeitet, aber ich garnicht mit gTextWidth() und gTextHeight() an die Abmessungen des formatierten Text komme.
Klar, dort gebe ich ja auch nirgends die Breite und Höhe des nutzbaren Bereiches an.

Gibt es da eine möglichkeit?

PS: Nein, es ist nicht dringend, sonden nur wünschenswert für die nächste Version.

Re: [Windows] 2DDrawing Befehle mit AntiAliasing durch GDI+

Verfasst: 09.02.2012 21:38
von Danilo
STARGÅTE hat geschrieben:Gibt es da eine möglichkeit?
Muss ich nochmal schauen, aber mir ist so aus dem Kopf nichts bekannt.

Die Funktion ist ja auch eher da um in einen definierten Bereich auszugeben
und automatisch die visuelle Anzeige anzupassen, z.B. mit '...' am Ende, wenn
der Text nicht reinpasst. Hatte auch nichts gesehen um eine eigene Umbruch-
funktion dabei anzugeben, was ich sonst eingebaut hätte. Ich schaue nochmal.