Introduction

We auto-generate game images to meet your needs.

Implementation

The game image is located at:

http://connect.newhaze.com/images/?gid={GAME-ID}&width={WIDTH}&height={HEIGHT}

You need to change {GAME-ID} to the ID of the game to get an image for, {WIDTH} to the desired width of the image and {HEIGHT} to the desired image height. We will then get a matching image or automatically generate one.

Embedding images

To embed the image, you can simply use an img tag.

<img src="http://connect.newhaze.com/images/?gid={GAME-ID}&width={WIDTH}&height={HEIGHT}" />

We prefer it if you save the resulting image to your server rather than constantly requesting our images.

Saving images

To save a game image using PHP, you can use code similar to this:

<?php
$game_id
=300; //the game ID of the image you want to save
$width=100; //the width of the desired image
$height=100; //the height of the desired image
$save_path='image.gif'; //the path to save the image to

copy('http://connect.newhaze.com/images/?gid='.$game_id.'&width='.$width.'&height='.$height,$save_path);
?>

You might want to modify, for example, to check the image type, and modify the save path extension to suit the image type.


© 2012 NewHaze   Icons by Pixel Mixer   Help