Re: gtkmm website source link



Hi,

I use a gdk pixbuff to work on jpeg. It works perfectlly. I can get a guint8 * table, and put the pixels in matrix to work with the red,green,blue pixels. And then do the oposite create a gtk pixbuff with my matrices.

All is ok if i don't change the size of the image: i want to rotate my matrice and then to use pixbuf=create_from_data(..); with a table of guint. And that do not work.

Could someone help me ? (see a part of my code just below )


Thank you very much.
LEBON Sylvain
____

int val=r.get_hauteur()*r.get_largeur()*3;

   guint8 suite[val];
   int i=0,x,y;
   for( y=0;y<r.get_hauteur();y++)
   {
       for( x=0;x<r.get_largeur();x++)
       {
if(r.get_pixel(x,y)!=-1)suite[i]=r.get_pixel(x,y);i++;
           if(v.get_pixel(x,y)!=-1)suite[i]=g.get_pixel(x,y);i++;
           if(b.get_pixel(x,y)!=-1)suite[i]=b.get_pixel(x,y);i++;
       }
   }
Glib::RefPtr<Gdk::Pixbuf> new_pix=Gdk::Pixbuf::create_from_data(suite,pixbuf->get_colorspace(),false,8,r.get_largeur(),r.get_hauteur(),pixbuf->get_rowstride());
   new_pix->save(nom,"jpeg");
begin:vcard
fn:LEBON Sylvain
n:Sylvain;LEBON
email;internet:lebon efrei fr
tel;cell:0688012148
version:2.1
end:vcard



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