XForms: Using flimage_add_text

From: jprinos@dehavilland.ca
Date: Fri Feb 16 2001 - 10:27:32 EST

  • Next message: Steve Lamont: "Re: XForms: Using flimage_add_text"

    # To subscribers of the xforms list from jprinos@dehavilland.ca :

    Hello all,

    I've been appointed a small side-task: auto-generate 200 gifs which contain a
    number (1-200).

    I wanted to use XForms because the image interface is easy. I generated a gif
    (800x600, indexed to 256 colours, white background) using gimp. I read it in and
    then I want to annotate it using flimage_add_text and then spit it out.

    The images appear but I don't see any annotation.

    After reading the friendly manual, I have some specific questions about
       arg #3, len is the length of the string?
       what exactly do args 6&7 (tcolor & bcolor) represent wrt "tran"? What does
       "tran" represent?
       tx & ty are pixels from the origin? The reason I'm asking is that they're
       declared double.
       Should the saved image contain the annotation? Am I barking up the wrong tree

    Thanks in advance, sorry for the dumbass questions

    ******CODE STarts here******
    #include <forms.h>
    #include <string.h>

    int main(int argc, char **argv);

    int main(int argc, char **argv)
    FL_IMAGE *image;
    int count, max_count = 5;
    char buffer[5];

        fl_initialize(&argc, argv, 0, 0, 0);


        for(count = 0; count <= max_count; count++)
         image = flimage_load("blank.gif");
         memset(buffer, '\0', 5);
         sprintf(buffer, "%d", count);
         flimage_add_text(image, buffer, strlen(buffer), FL_BOLD_STYLE,
                   FL_HUGE_SIZE, FL_BLACK, FL_WHITE, 1,
                   (double)image->w/2, (double)image->h/2, 0);
         flimage_dump(image, buffer, "gif");


    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    This archive was generated by hypermail 2b29 : Fri Feb 16 2001 - 06:21:40 EST