Re: gtkmm website source link



Forget my question i've figured it out.
the rowstride value was the rox stride ou the old image so ... ( i'm french so the time to figure out what does mean rowstride )

so sorry to keep you busy for nothing

Lebon Sylvain



Lebon Sylvain a écrit :

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");

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

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]