#ifdef HAVE_HAIKU
void *bitmap = BBitmap_new (width, height, 1);
+
+ if (!bitmap)
+ return -1;
+
BBitmap_import_mono_bits (bitmap, bits, width, height);
#endif
convert_mono_to_color_image (f, img, fg, bg);
#elif defined HAVE_NS
img->pixmap = ns_image_from_XBM (data, img->width, img->height, fg, bg);
+#elif defined HAVE_HAIKU
+ img->pixmap = BBitmap_new (img->width, img->height, 0);
+
+ if (img->pixmap)
+ {
+ int bytes_per_line = (img->width + 7) / 8;
+
+ for (int y = 0; y < img->height; y++)
+ {
+ for (int x = 0; x < img->width; x++)
+ PUT_PIXEL (img->pixmap, x, y,
+ (data[x / 8] >> (x % 8)) & 1 ? fg : bg);
+ data += bytes_per_line;
+ }
+ }
#endif
}
rc = xbm_read_bitmap_data (f, contents, end, &img->width, &img->height,
&data, 0);
+
if (rc)
{
unsigned long foreground = img->face_foreground;