Jump to content

Simple Rotation of PNG Question


Skizmata
 Share

Recommended Posts

Why would this not work?

#include <GDIPlus.au3>

rotate('example.png', 90)

Func rotate($filePath, $degs)
    _GDIPlus_Startup()

    $hImage = _GDIPlus_ImageLoadFromFile($filePath)
    _GDIPlus_GraphicsRotateTransform($hImage, $degs)
    _GDIPlus_ImageSaveToFile($hImage, 'out.png')

    _GDIPlus_Shutdown()
EndFunc   ;==>rotate

 

I get @Error 10 and @Extended 2 from _GDIPlus_GraphicsRotateTransform($hImage, $degs) but I am having a hard time finding what those errors mean in the help file.  This seems like a pretty simple thing to do but clearly I am missing something.

Also, I just noticed that my output file is twice as big as my example.png... is it really a bmp?

Thank you all.

Long time user rare forum poster.

Edited by Skizmata

AutoIt changed my life.

Link to comment
Share on other sites

_GDIPlus_GraphicsRotateTransform ( $hGraphics, $fAngle [, $iOrder = 0] )

You are using an image handle not a graphics handle.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...