Re: [e-users] newbie help needed

2005-11-03 Thread Gerald Dachs
You are fooling us, aren't you? First, this is not an enlightenment
question. This is basic c problem.

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


I suppose it is a copy and paste error that you have this two times.

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

 for(i=190;i280;i++)
   {
 for(j=215;j283;j++)
   {
 = data[3*(i+w*j)+0] = (im-rgb_data[3*(i+w*j)+0]);

You have not allocated memory for data.

 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]);
   }
   }

Gerald





---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users


[e-users] newbie help needed

2005-11-02 Thread Jay

Hi all,
I m trying to copy a small part of an image and then use the 
information of the small part to generate a new image. its same as 
copy paste scenario.
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;i280;i++)
 {
   for(j=215;j283;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 Potharaju

Reality is merely an illusion, albeit a very persistent one.-Einstein 
	



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42 plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users