--- parser3/src/classes/image.C 2001/04/11 13:03:39 1.6 +++ parser3/src/classes/image.C 2001/04/11 17:00:53 1.8 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: image.C,v 1.6 2001/04/11 13:03:39 paf Exp $ + $Id: image.C,v 1.8 2001/04/11 17:00:53 paf Exp $ */ #include "pa_config_includes.h" @@ -341,12 +341,6 @@ static void _load(Request& r, const Stri "can not open background image '%s'", file_name_cstr); } -inline void v2rgb(int v, int& r, int& g, int& b) { - r=v>>8*2 & 0xFF; - g=v>>8*1 & 0xFF; - b=v & 0xFF; -} - /// ^image.create[width;height] bgcolor=white /// ^image.create[width;height;bgcolor] static void _create(Request& r, const String& method_name, Array *params) { @@ -354,16 +348,13 @@ static void _create(Request& r, const St int width=(int)r.process(*static_cast(params->get(0))).as_double(); int height=(int)r.process(*static_cast(params->get(1))).as_double(); - int bgcolor_value=0xFFFFFF; + int bgcolor_value=0xffFFff; if(params->size()>2) bgcolor_value= (int)r.process(*static_cast(params->get(2))).as_double(); - gdImagePtr image=gdImageCreate(width, height); - { - int r,g,b; v2rgb(bgcolor_value, r,g,b); - gdImageFilledRectangle(image, 0, 0, width-1, height-1, - gdImageColorExact(image, r,g,b)); - } + gdImage *image=new(pool) gdImage(pool); + image->Create(width, height); + image->FilledRectangle(0, 0, width-1, height-1, image->Color(bgcolor_value)); static_cast(r.self)->set(0, width, height, image); }