GDI+ Schrift verpixelt

  • Moin,
    Ich habe das Problem das bei GDI+ bei mir die Schrift total Verpixelt und so aussieht, sieht einfach nicht schon aus, was kann ich da machen?

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    $h_Gui1 = GUICreate ("Test",1024,768)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    GUISetState ()
    _GDIPlus_Startup()
    $h_Grafic = _GDIPlus_GraphicsCreateFromHWND($h_Gui1)
    $f_Famaily = _GDIPlus_FontFamilyCreate ("Arial")
    $f_Arial = _GDIPlus_FontCreate($f_Famaily, 19)
    $p_Brush = _GDIPlus_BrushCreateSolid (0xFFFF0000)
    $h_Format = _GDIPlus_StringFormatCreate ()
    $g_Table = _GDIPlus_BitmapCreateFromGraphics(1024, 768, $h_Grafic)
    $b_Table = _GDIPlus_ImageGetGraphicsContext($g_Table)

    [/autoit] [autoit][/autoit] [autoit]

    $t_Layout = _GDIPlus_RectFCreate (150,108)
    $a_Info = _GDIPlus_GraphicsMeasureString ($b_Table,"Test blaaa blaa AutoIt.de",$f_Arial,$t_Layout,$p_Brush)
    _GDIPlus_GraphicsDrawStringEx ($b_Table,"Test blaaa blaa AutoIt.de",$f_Arial,$a_Info[0],$h_Format,$p_Brush)
    _GDIPlus_GraphicsDrawImageRect($h_Grafic, $g_Table, 0, 0,1024,768)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    Switch GUIGetMsg ()
    Case -3
    Exit
    EndSwitch
    WEnd

    [/autoit]

    mfg. Jam00

    Einmal editiert, zuletzt von Jam00 (6. Juli 2011 um 13:04)

  • _GDIPlus_GraphicsSetSmoothingMode kenne ich auch, aber ich sehe keinen unterschied bei dem Text und die andere Funktion kann ich leider nicht finden in der GDIPlus.au3

    mfg. Jam00

  • Zitat

    _GDIPlus_GraphicsSetSmoothingMode kenne ich auch, aber ich sehe keinen unterschied bei dem Text und die andere Funktion kann ich leider nicht finden in der GDIPlus.au3


    GDIP.au3 ist kein Schreibfehler ;). Das ist eine UDF mit weiteren GDI+ DllCalls aus dem englischen AutoIt Forum. Diese Funktion meinte ich:

    Spoiler anzeigen
    [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_GraphicsSetTextRenderingHint
    ; Description ...: Seets the contrast value of a Graphics object
    ; Syntax.........: _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $iTextRenderingHint)
    ; Parameters ....: $hGraphics - Pointer to a Graphics object
    ; $iTextRenderingHint - Text rendering mode:
    ; |0 - Character is drawn using the currently selected system font smoothing mode (also called a rendering hint)
    ; |1 - Character is drawn using its glyph bitmap and hinting to improve character appearance on stems and
    ; +curvature
    ; |2 - Character is drawn using its glyph bitmap and no hinting. This results in better performance at the
    ; +expense of quality
    ; |3 - Character is drawn using its antialiased glyph bitmap and hinting. This results in much better quality
    ; +due to antialiasing at a higher performance cost
    ; |4 - Character is drawn using its antialiased glyph bitmap and no hinting. Stem width differences may be
    ; +noticeable because hinting is turned off
    ; |5 - Character is drawn using its glyph Microsoft ClearType bitmap and hinting. This type of text rendering
    ; +cannot be used along with $CompositingModeSourceCopy
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: _GDIPlus_GraphicsGetTextRenderingHint
    ; Link ..........; @@MsdnLink@@ GdipSetTextRenderingHint
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $iTextRenderingHint)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "hwnd", $hGraphics, "int", $iTextRenderingHint)

    [/autoit] [autoit][/autoit] [autoit]

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_GraphicsSetTextRenderingHint

    [/autoit]


    Wenn du den den Text Rendering Modus einer Graphic damit auf 3 setzt (maximale Qualität), sieht es perfekt aus.