GDI+ und gif Bilder

  • Hallo!

    Ich habe folgendes Script.

    Spoiler anzeigen
    [autoit]


    $NewW = 1000
    $NewH = 1000
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($FILE)

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

    ; Create sized BMP
    $hGraphicsImg = _GDIPlus_ImageGetGraphicsContext($hImage)
    $hBitMap = _GDIPlus_BitmapCreateFromGraphics($NewW,$NewH,$hGraphicsImg)
    _GDIPlus_GraphicsDispose($hGraphicsImg)
    ; ------------

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

    ; Create sized BMP
    $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitMap)
    _GDIPlus_GraphicsDrawImageRect($hGraphics,$hImage,0,0,$NewW,$NewH)
    _GDIPlus_GraphicsDispose($hGraphics)
    ;-----------------

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

    _GDIPlus_ImageSaveToFile($hBitMap,$NewFile)

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

    ; Cleanup
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitMap)

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

    _GDIPlus_Shutdown()

    [/autoit]

    Problem damit ist das es keine Gif Bilder umwandelt.

    Weiß jemand Rat?

    If not :?: then ?( else :thumbup:

  • Hi!
    Also ich wollte das Script von progandy (siehe spoiler) zum Verkleinern von gif Bildern verwenden.
    Leider funktioniert dieses script "nur" mit jpg und png.
    Ist es möglich dieses Script so umzubauen, dass auch gif Bilder kleiner gemacht werden können?

    Spoiler anzeigen
    [autoit]


    $FILE = "D:\Dokumente\Dateien von Andreas\Eigene Bilder\Banner.bmp"
    $NewFile = @DesktopDir & "\test.jpg"
    $NewW = 100
    $NewH = 10
    #include <GDIplus.au3>
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($FILE)

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

    ; Create sized BMP
    $hGraphicsImg = _GDIPlus_ImageGetGraphicsContext($hImage)
    $hBitMap = _GDIPlus_BitmapCreateFromGraphics($NewW,$NewH,$hGraphicsImg)
    _GDIPlus_GraphicsDispose($hGraphicsImg)
    ; ------------

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

    ; Create sized BMP
    $hGraphics = _GDIPlus_ImageGetGraphicsContext($hBitMap)
    _GDIPlus_GraphicsDrawImageRect($hGraphics,$hImage,0,0,$NewW,$NewH)
    _GDIPlus_GraphicsDispose($hGraphics)
    ;-----------------

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

    _GDIPlus_ImageSaveToFile($hBitMap,$NewFile)

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

    ; Cleanup
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitMap)

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

    _GDIPlus_Shutdown()

    [/autoit]

    If not :?: then ?( else :thumbup: