wpsc_preview_image_bgcolor

Located in: misc.functions.php

Functions that call this hook: nzshpcrt_display_preview_image()

Arguments Accepted: array( 255, 255, 255 )

Version Introduced: 3.8.9

Description: Specify the background color of the preview image.

Code in context:

[php firstline=”408″ highlight=”409″]

// Create temp resized image

$bgcolor_default = apply_filters( ‘wpsc_preview_image_bgcolor’, array( 255, 255, 255 ) );

$temp_img = ImageCreateTrueColor( $temp_w, $temp_h );

$bgcolor = ImageColorAllocate( $temp_img, $bgcolor_default[0], $bgcolor_default[1], $bgcolor_default[2] ) ;

ImageFilledRectangle( $temp_img, 0, 0, $temp_w, $temp_h, $bgcolor );

ImageAlphaBlending( $temp_img, TRUE );

ImageCopyResampled( $temp_img, $src_img, 0, 0, 0, 0, $temp_w, $temp_h, $source_w, $source_h );

$dst_img = ImageCreateTrueColor( $width, $height );

$bgcolor = ImageColorAllocate( $dst_img, $bgcolor_default[0], $bgcolor_default[1], $bgcolor_default[2] );

ImageFilledRectangle( $dst_img, 0, 0, $width, $height, $bgcolor );

ImageAlphaBlending( $dst_img, TRUE );

[/php]