contents   index   previous   next



GD copyResized()

syntax:

gd.copyResized(source, dstX, dstY, srcX, srcY,

               dstW, dstH, srcW, srcH)

gd.copyResized(source, dstPoint, srcPoint, dstW,

               dstH, srcW, srcH)

where:

source - A gd object to copy from

 

dstX - Horizontal destination pixel in current object

 

dstY - Vertical destination pixel in current object

 

dstPoint - Destination pixel in current object.

 

srcX - Horizontal source pixel in source object

 

srcY - Vertical source pixel in source object

 

srcPoint - Source pixel in source object.

 

dstW - Width of region in current object

 

dstH - Height of region in current object

 

srcW - Width of region in source object

 

srcH - Height of region in source object

 

return:

void.

 

description:

This method is very similar to GD copy(), except that it has the additional option of resizing the image in the process of copying. This method will stretch or shrink the region as appropriate in order to fit in the destination area. Specifying the same destination and source sizes is the equivalent of calling GD copy(). See GD copy() for more description.

 

see:

#link <gd>, GD copy()

 

example:

// Copy top-left 4x4 square from "test.gif"

// and magnify it four times

// to a size of 16x16 in the destination image

var source = GD.fromGif("test.gif");

var dest = new GD( 16, 16 );

dest.copyResized(source, [0,0], [0,0], 16, 16, 4, 4);

 


GD dashedLine()