- if ((data[index] == red) &&
- (data[index+1] == green) &&
- (data[index+2] == blue))
- {
- gdk_image_put_pixel( mask_image, i, j, 1 );
- }
- else
- {
- gdk_image_put_pixel( mask_image, i, j, 1 );
- }
- index += 3;
- }
-
- GdkGC *mask_gc = gdk_gc_new( m_bitmap );
-
- gdk_draw_image( m_bitmap, mask_gc, mask_image, 0, 0, 0, 0, image.GetWidth(), image.GetHeight() );
-
- gdk_gc_unref( mask_gc );
- gdk_image_destroy( mask_image );
-
- return FALSE;
+ if ((data[index] == red) &&
+ (data[index+1] == green) &&
+ (data[index+2] == blue))
+ {
+ if (start_x == -1)
+ start_x = i;
+ }
+ else
+ {
+ if (start_x != -1)
+ {
+ gdk_draw_line( m_bitmap, gc, start_x, j, i-1, j );
+ start_x = -1;
+ }
+ }
+ index += 3;
+ }
+ if (start_x != -1)
+ gdk_draw_line( m_bitmap, gc, start_x, j, i, j );
+ }
+
+ gdk_gc_unref( gc );
+
+ return TRUE;