Mail Archives: djgpp/1993/09/08/16:44:04
Hello,
I'm having a problem with the GrBuildPixmapFromBits() function from
libgrx. What is the format for the data parameter? What I want to do
is build a pixmap from an X-Window bitmap file, but when using
GrBuildPixmapFromBitsBits() and GrPatternFilledBox(), the pattern
comes out shifted.
=== code fragment=====
#include "test.bmp"
GrPattern *p;
p=GrBuildPixmapFromBits(test_bits,test_width,test_height,GrWhite(),GrBlack());
GrPatternFilledBox(0, 0, test_width, test_height, p);
=== end code ========
=========== test.bmp ============
#define test_width 16
#define test_height 16
static char test_bits[] = {
0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x7f, 0xfe,
0x7f, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x60, 0x06,
0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06};
=========== end test.bmp =======
The displays look something like this:
In X-Windows: In LIBGRX:
------------- ----------------
## ## ## ##
## ## ########### ###
## ## ########### ###
## ## ## ##
## ## ## ##
####### ####### ## ##
####### ####### ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
## ## ## ##
Any ideas?
Paul Bramel
paulbr AT comm DOT mot DOT com
- Raw text -