Jump to content
Sign in to follow this  
Piyush

Decreasing Image resolution..

Recommended Posts

Piyush

Hi! ol...

i just needed a code for decreasing resolution i.e making a thumbnail of an image...with same quality

and of same extension...if the original image is png then the thumb should also be a png image..

:blink:

plz help...


[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Share this post


Link to post
Share on other sites
EndFunc

AutoIt can't do this natively. Look for GDIPlus.au3 and try that. That should work for you.


EndFuncAutoIt is the shiznit. I love it.

Share this post


Link to post
Share on other sites
Piyush

@endfunc thnks for ur reply ..i knw that it can be done by GDI library but i know nothing about image processing so..it is very difficult for me..to understand..

Edited by Piyush

[font="Comic Sans MS"][size="7"]Piyush.....[/size][/font][font="Palatino Linotype"][size="2"]Some Of My Scripts...Cool Font Generator Train Searcher and Tracer[/size][/font]

Share this post


Link to post
Share on other sites
matwachich

Here is a function for you:

Func _imageResize($oldImage, $newImage, $newW, $newH, $startGdiP = True)
    If $startGdiP Then _GDIPlus_Startup()

    $img =      _GDIPlus_ImageLoadFromFile($oldImage)
    $gContext = _GDIPlus_ImageGetGraphicsContext($img)

    $newBmp =   _GDIPlus_BitmapCreateFromGraphics($newW, $newH, $gContext)
    $gNewContext = _GDIPlus_ImageGetGraphicsContext($newBmp)

    _GDIPlus_GraphicsDrawImageRect($gNewContext, $img, 0, 0, $newW, $newH)

    _GDIPlus_ImageSaveToFile($newBmp, $newImage)

    _GDIPlus_ImageDispose($img)
    _GDIPlus_GraphicsDispose($gContext)
    _GDIPlus_GraphicsDispose($gNewContext)
    _GDIPlus_BitmapDispose($newBmp)

    If $startGdiP Then _GDIPlus_Shutdown()
EndFunc  ;==>_ImageResize

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.