Un motore di ricerca WordPress per sviluppatori e autori di temi



_crop_image_resource ›

Da2.9.0
Deprecaton/a
_crop_image_resource ( $img, $x, $y, $w, $h )
Parametri: (5)
  • (resource) $img Image resource.
    Richiesto:
  • (float) $x Source point x-coordinate.
    Richiesto:
  • (float) $y Source point y-cooredinate.
    Richiesto:
  • (float) $w Source width.
    Richiesto:
  • (float) $h Source height.
    Richiesto:
Ritorna:
  • (resource) (maybe) cropped image resource.
Definito a:
Codex:

Crops an image resource. Internal use only.



Sorgenti

function _crop_image_resource( $img, $x, $y, $w, $h ) {
	$dst = wp_imagecreatetruecolor( $w, $h );
	if ( is_resource( $dst ) ) {
		if ( imagecopy( $dst, $img, 0, 0, $x, $y, $w, $h ) ) {
			imagedestroy( $img );
			$img = $dst;
		}
	}
	return $img;
}