You can use WarpBlt to scale the form.

| input output |

input :=  Smalltalk ui icons iconNamed: #class.
output := Form extent: 128 asPoint depth: 32.

(WarpBlt toForm: output)
                                sourceForm: input;
                                cellSize: 1;
                                combinationRule: Form over;
                                copyQuad: input boundingBox innerCorners 
toRect: (0 asPoint extent: 127 asPoint).

output writePNGFileNamed: 'somefile.png'

Best regards,
Henrik



From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Trussardi Dario Romano
Sent: Thursday, December 22, 2016 6:45 PM
To: Any question about pharo is welcome <pharo-users@lists.pharo.org>
Subject: Re: [Pharo-users] Scaled image

Ciao,



Morphs have an extent method that you can passes the size as a point in the x@y 
format, there are also width: and height: methods that take simple numbers

            Can explain what i need do  with some code, example ?

            After the scaled i need to save the new scaled image on the disk.

            Thanks


On Thu, Dec 22, 2016 at 6:02 PM Trussardi Dario Romano 
<dario.trussa...@tiscali.it<mailto:dario.trussa...@tiscali.it>> wrote:
Ciao,

        after upload an image   ( with MAFileDescription support )

        i need to create the relative logo image with specific size 128 x 128 
px.

        How i can scale the image into Pharo?

        And for deployment system based on Gemstone ?

        Thanks,

                Dario

Reply via email to