Re: Handling long SVG strings in Path



On Thu, 2009-05-07 at 09:25 -0500, Jamie Lahowetz wrote:
> I went with the fopen to open a file containing the SVG data. The
> problem that I'm encountering is that nothing is being drawn on the
> canvas. I thought that maybe it was because the string was to long. So
> I made it very small, something like "M 20 20 L 4000 4000", which
> should draw a simple line. But, alas this produced no line. Not sure
> what the problem is but here is the code, any help would be
> appreciated. 
> 
> #define MAX_LEN 5000
> 
> void read_gis(char *gis)
> {    
>     FILE * gis_file;
>     gchar *path_data;
>     
>     gis_file = fopen(gis,"r");
>     if (gis_file != NULL)
>     {
>         char path[MAX_LEN + 1];
>         fgets(path, MAX_LEN + 1, gis_file);
>         printf("%s\n",path);
>         fclose (gis_file);
>         
>         path_data = path;
> 
> goo_canvas_path_new(root,path_data,"stroke-color","white","line-width",5.0,NULL);
>     }
> }

That works here (with a black canvas so the white path can be seen!).

Damon




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]