Re: [Pharo-users] Scaled image

2016-12-22 Thread Henrik Nergaard
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 
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 
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



Re: [Pharo-users] Scaled image

2016-12-22 Thread Stephan Eggermont

On 22/12/16 17:01, Trussardi Dario Romano 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?


You can, but you might not want to. Scaling images is rather slow, you 
often want an external process for that, especially if you want to 
operate from disk to disk. You do not want to block your image too long, 
and you might want to have your front-end web server serve those logo's 
instead of your smalltalk image.  ImageMagick can be useful there.


Stephan





Re: [Pharo-users] Scaled image

2016-12-22 Thread Trussardi Dario Romano
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 
>  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
> 



Re: [Pharo-users] Scaled image

2016-12-22 Thread Dimitris Chloupis
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

On Thu, Dec 22, 2016 at 6:02 PM Trussardi Dario Romano <
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
>
>


[Pharo-users] Scaled image

2016-12-22 Thread Trussardi Dario Romano
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