GDI+ Prozessorauslastung reduzieren

  • Hi,

    gibt es irgendeinen Trick um die Prozessorauslastung durch GDI+ zu reduzieren?

    mfg

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

    Einmal editiert, zuletzt von chip (28. September 2011 um 09:54)

  • Damit verändert man ja die Renderqualität des Grafik-Objekts, das will ich allerdings nicht. Daher eher an irgendeinen Trick um z.b. GDI+ statt mit der CPU mit der GPU render zu lassen oder dergleiche.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Also z.b. bei diesem hier ist es, bei einem AMD Athlon 64 X2 4600+ (2,4 GHz), bei 46 wenn die Maus nicht bewegt wird und 50 Prozent wenn die Maus bewegt wird:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>

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

    Opt("GuiOnEventMode", 1)
    Opt("MouseCoordMode", 0)

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

    OnAutoItExitRegister("_end")

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

    $Gui = GUICreate("Beispiel", 800, 600)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
    GUISetState(@SW_SHOW)

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

    _GDIPlus_Startup()

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

    $chipset = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\chipsets\1.png")

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

    $graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(800, 600, $graphic)
    $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)

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

    ;~ _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, 0, 0, 256, 1024, 672, 0, 128, 512)
    ;~ _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, 0, 0, 256, 1024, 0, 515, 128 / 6, 512 / 6)
    ;~ _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    ;~ _GDIPlus_GraphicsClear($buffer, 0xFF000000)

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

    $mouscordsalt = MouseGetPos()
    While 1
    $mouscords = MouseGetPos()
    If $mouscordsalt[0] <> $mouscords[0] Or $mouscordsalt[1] <> $mouscords[1] Then
    ;~ $mouscordsalt[0] = $mouscords[0]
    ;~ $mouscordsalt[1] = $mouscords[1]
    ;~
    ;~ If $mouscords[0] Or $mouscordsalt[1] <> $mouscords[1] Then
    _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, 0, 0, 256, 1024, 672, 0, 128, 512)
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    _GDIPlus_GraphicsClear($buffer, 0xFF000000)
    ;~ EndIf
    EndIf
    WEnd

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

    Func CLOSEClicked()
    Exit
    EndFunc ;==>CLOSEClicked

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

    Func _end()
    _GDIPlus_ImageDispose($chipset)
    _GDIPlus_GraphicsDispose($graphic)
    _GDIPlus_GraphicsDispose($buffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_Shutdown()
    EndFunc ;==>_end

    [/autoit]

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Mh bei anderen Scripten ohne GDI+ habe ich das nicht, darum dachte ich es liegt an GDI+

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.