From: Kouhei S. <ko...@co...> - 2005-09-18 12:29:06
|
須藤です. Gdk::Pixbuf#pixelsのサイズの計算方法がちょっとまずいかもしれ ません. http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbufError のちょっと上の方にあるNoteには以下のように書いてあります. If you are doing memcpy() of raw pixbuf data, note that the last row in the pixbuf may not be as wide as the full rowstride, but rather just as wide as the pixel data needs to be. That is, it is unsafe to do memcpy (dest, pixels, rowstride * height) to copy a whole pixbuf. Use gdk_pixbuf_copy() instead, or compute the width in bytes of the last row as width * ((n_channels * bits_per_sample + 7) / 8). 現在のGdk::Pixbuf#pixelsはrowstride * heightでサイズを計算し ています.サイズの計算方法をgdk_pixbuf_copy()と同じようにし た方がよいのではないでしょうか? |