Jump to content

scaleimage


Recommended Posts

Hi, I made the following script to scale a picture and save it to a file but it doesn't work: 

#include <GDIPlus.au3>
#include <WindowsConstants.au3>

Hotkeyset ("{F2}","_scale")

While 1
   Sleep(100)
WEnd

Func _scale()
   $hImage = _GDIPlus_BitmapCreateFromFile ( @ScriptDir & "/Data/2.bmp" )
   $hScaleImage = _GDIPlus_ImageScale ( $hImage, 0.5, 0.5)
    _GDIPlus_ImageSaveToFile ( $hScaleImage,  @ScriptDir & "/Data/22.bmp" )
EndFunc

Please help,

regards

Derrod

Edited by derrod
Link to comment
Share on other sites

derrod,

dies ist ein englishsprachiges Forum. Also, wenn du in Deutsch schreiben möchtest, dann besuche einfach www.autoit.de. Ansonsten schreibe bitte in Englisch!

Back to englisch:

Please post your full code to see what's wrong.

Br,

UEZ

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

Try this:

#include <GDIPlus.au3>
#include <WindowsConstants.au3>

_GDIPlus_Startup()
Hotkeyset ("{F2}","_scale")
Hotkeyset ("{ESC}","_Exit")

While 1
   Sleep(100)
WEnd

Func _scale()
   $hImage = _GDIPlus_BitmapCreateFromFile ( @ScriptDir & "/Data/2.bmp" )
   $hScaleImage = _GDIPlus_ImageScale ( $hImage, 0.5, 0.5)
    _GDIPlus_ImageSaveToFile ( $hScaleImage,  @ScriptDir & "/Data/22.bmp" )
EndFunc

Func _Exit()
    _GDIPlus_Shutdown()
    Exit
EndFunc

Br,

UEZ

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...