error loading pixmap from HD

Alan Coopersmith Alan.Coopersmith at Sun.COM
Mon Nov 2 07:57:54 PST 2009

XReadBitmapFile can only read *.xbm format bitmaps (i.e. 1-bit-per-pixel)
not multi-color pixmaps of any form.   libXpm offers equivalent functionality
for *.xpm pixmap files.    Other libraries from other projects provide
support for reading more advanced graphics formats.

	-Alan Coopersmith-           alan.coopersmith at
	 Sun Microsystems, Inc. - X Window System Engineering

Sotirios Karavarsamis wrote:
> 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
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at

More information about the xorg-devel mailing list