function LoadWBMP ($imgname) { $im = @ImageCreateFromWBMP ($imgname); /* Attempt to open */ if (!$im) { /* See if it failed */ $im = ImageCreate (20, 20); /* Create a blank image */ $bgc = ImageColorAllocate ($im, 255, 255, 255); $tc = ImageColorAllocate ($im, 0, 0, 0); ImageFilledRectangle ($im, 0, 0, 10, 10, $bgc); /* Output an errmsg */ ImageString ($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; } |