www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/09/08/16:44:04

From: Paul Bramel <paulbr AT cradhp01 DOT comm DOT mot DOT com>
Subject: GRX Pixmap data format
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp mail list)
Date: Wed, 8 Sep 93 15:27:37 CDT
Mailer: Elm [revision: 66.25]

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019