- /* *img = CreateCompatibleBitmap(*d, width, height); */
-
-#if !defined(__VISAGECPP__) /* fixme for OS/2 */
- /* create the bitmap with the same number of planes as the default display
- * (otherwise it wouldn't work for 16 color mode) */
- img->bitmap = CreateBitmap(width, height,
- GetDeviceCaps(*d, PLANES),
- depth /* bits per pixel */ , NULL);
+ /*JW: This is what it should be, but the picture comes out
+ just black!? It appears to be doing monochrome reduction,
+ but I've got no clue why. Using CreateBitmap() is supposed
+ to be slower, but otherwise ok
+ if ( depth == GetDeviceCaps(*d, BITSPIXEL) ) {
+ img->bitmap = CreateCompatibleBitmap(*d, width, height);
+ } else*/ {
+#ifdef __OS2__
+ img->bitmap = GpiCreateBitmap(*d, &bmih, 0L, NULL, NULL);
+ WinReleasePS(*d);
+#else
+ img->bitmap = CreateBitmap(width, height, 1 /* plane */ ,
+ depth /* bits per pixel */ , NULL);