Jump to content
Sign in to follow this  

Cropping Image in Prospeed

Recommended Posts



Just starting using prospeed (and AutoIt for that matter). I would like to know how to crop an image (say, 400*400 jpg or png) into a 50*50 image using specified co-ordinates (x1,x2,y1,y2). I understand there are many other ways of doing this in AutoIt, but I would like to know how to do it using Prospeed specifically.

I have tried using BitBltArray to copy and paste the picture array ($Mainarray) to another picture array ($array1). However, when I run CompareBytes with a previously cropped image the answer is not 0. I don't even know whether this is how to crop. Any help at all would be welcome. Here is the code:

$crop = CreateImage($width2, $height2)
            $array1 = InitFX($crop)

            BitBltArray($array1, 0, 0, $width2, $height2, $Mainarray, $x, $y, 0)
            $arrayInfos1  = DllStructCreate("long;long;long;dword;dword;long;long;long;long;long;long;long", $array1)
            $Pointer1     = DllStructGetData($arrayInfos1, 11) ; Get pointer for array1 @ long 11

            ;compare cropped bit with $pic
            $Compare = CompareBytes($Pointer1, $Pointer2, $size, 0)


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