[Glade-users] problem in showing rgba data



HI All,
         I want to show a rgba data in glade .So I fill a array with rgba data and         pass it to the 
data field of
 gdk_pixbuf_new_from_data const guchar (*data,GdkColorspace                 
colorspace,gbooleanhas_alpha,intbits_per_sample,                                                   int 
width,int height,int rowstride, GdkPixbufDestroyNotify destroy_fn,
gpointer destroy_fn_data);
 I set the width to 100,height to 100 and I set the rowstrid field to width*3.After that I show the pixbuf 
created
by the function and it is showing perfectly.But when I reduce the width and height to 20 ,20 it not showing 
perfectly         i.e the buffer area is not filled properly .I fill the array of rgba data  like follows,
        char argb_buf[20*20*4];
        for(i=0;i<20*20*4;i+=4)
        {
                argb_buf[i]=255;        //For Red
                argb_buf[i+1]=0;        //For Green
                argb_buf[i+2]=0;        //For Blue
                argb_buf[i+3]=255;      //For Alpha 
        }
        For that it must show a area of 20*20 with a red color .But it not showing like that .For higher 
value of width and
        height I showing perfectly.Like if I gave 100 to the width and 100 to the height it show a red area 
of 100*100.
        Actually I do not understand how to fill the rowstride field of the above function.Please tell me how 
to fill the
        fields of the above function so that I get the proper out put .Thanks in advance .


Regards 
Amit Kumar Bag


       
---------------------------------
 Once upon a time there was 1 GB storage in your inbox. Click here for happy ending.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20070821/549de19b/attachment.html 




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