Fwd: error loading pixmap from HD

Sotirios Karavarsamis s.karavarsamis at gmail.com
Sun Nov 1 13:27:22 PST 2009


---------- Forwarded message ----------
From: Sotirios Karavarsamis <s.karavarsamis at gmail.com>
Date: Sun, Nov 1, 2009 at 11:26 PM
Subject: error loading pixmap from HD
To: xorg-devel at lists.x.org


Hello,

I am currently trying to load an image from disk and splash it on
screen using XCopyArea(), and in the
following snippet to perform the loading step:

   res = XReadBitmapFile(display, win, BMP_TILE_BLOCKS, &w, &h,
&game->platform->bmpTiles, &x_hot, &y_hot);

   switch (res)
   {
   case BitmapOpenFailed:
       printf("bitmap open failed\n");
       break;
   case BitmapFileInvalid:
       printf("bitmap invalid file\n");
       break;
   case BitmapNoMemory:
       printf("bitmap no memory!\n");
       break;
   case BitmapSuccess:
       printf("bitmap success\n");
   default:
       printf("other error status\n");
       break;
   }

I am constantly getting a "bitmap invalid file" error (case #2 in the
above switch control). In the snippet above, the constant
BMP_TILE_BLOCKS is a string representing the path to a PBM/XPM/BMP
file on disk. However, neither image format works. How should I
correctly load the image file from disk? Or I am I scrueing something
in the snippet itself? Also, which image formats work correctly with
this particular function?

I am looking forward to your reply.

A many thank you in advance,
Sotiris Karavarsamis
Computer Science Department, UOI



More information about the xorg mailing list