# # # graph_image_util.cfv # # # # # # # get_rectangular_image() # # # subroutine(get_rectangular_graphs_image_fileref( string web_server_root_path, string profile_name, int width, int height, int r, int g, int b), ( # This creates the image file name from the given parameters # and creates the image if it doesn't yet exist. It returns # the image_file_path. debug_message("#### get_rectangular_image() \n"); string image_file_name = md5_digest('image_' . width . '_' . height . '_' . r . '_' . g . '_' . b) . ".gif"; string image_file_path = web_server_root_path . "graphs/" . profile_name . "/" . image_file_name; if (!file_exists(image_file_path)) then ( string img = create_image(width, height); string img_color = allocate_image_color(img, r, g, b); add_rectangle_to_image(img, img_color, 0, 0, width - 1, height - 1, true); write_image_to_disk(img, image_file_path, "GIF"); ); # Return image file reference fileref("graphs/" . profile_name . "/" . image_file_name); ));