Hi all,
I m trying to take a small part of an image and then use the information of the small part to generate a new image. following is my code can someone please point out where am i going wrong and proab give me some suggestions.

The arrow points to where the program crashes.

       Display *disp;
       ImlibData *id;
       XSetWindowAttributes attr;
       Window win;
       ImlibImage *im;
       Pixmap p,m;
       int w,h;

         if (argc<=1)
         {
           printf("Usage:n %s image_filen",argv[0]);
           exit(1);
         }

       disp=XOpenDisplay(NULL);

       id=Imlib_init(disp);


       im=Imlib_load_image(id,argv[1]);
w=im->rgb_width;h=im->rgb_height;

       unsigned char* data;
       ImlibImage *newIm; ImlibImage *newId;
       int i,j;

 unsigned char* data;
       ImlibImage *newIm; ImlibImage *newId;
       int i,j;

       for(i=190;i<280;i++)
         {
           for(j=215;j<283;j++)
             {
=>             data[3*(i+w*j)+0] = (im->rgb_data[3*(i+w*j)+0]);
               data[3*(i+w*j)+1] = (im->rgb_data[3*(i+w*j)+1]);
               data[3*(i+w*j)+2] = (im->rgb_data[3*(i+w*j)+2]);
             }
         }
       unsigned * val;
       newIm = Imlib_create_image_from_data(newId,data,val,100,68);
thanks in advance
jay


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to