Subject:
Re: loading bitmaps into pixmaps
From:
"Greg Haerr" ####@####.####
Date:
26 Jan 2001 18:13:53 -0000
Message-Id: <04a801c087c3$451ee900$15320cd0@gregh>
: I have an application with xbm type data compiled in as a bitmap.
:
: I am using sections of this bitmap to represent each letter.
Hmmm.... It looks like you need the new GrNewBitmapFromData
and GrNewPixmapFromData functions I wrote the night after
I released pre7 ;-)
Most likely you will need to both bit-reverse and then byte-swap
the pixmap data before calling GrCopyArea. That's what my
routines do.
I will be releasing the pixmap stuff very shortly, as part of my new
XtoNX.h Xlib-to-Nano-X conversion header file. I've ported
xfreecell with very few source modifications directly from Xlib
to Nano-X. Let me know if you want a copy of the functions sooner
and I'll send them to you.
Regards,
Greg
:
: When I do, it comes out garbled, as though it were smudged.
:
: Advice?
:
:
:
: It looks like:
: #define PalmFont0_width 1168
: #define PalmFont0_height 11
: #define PalmFont0_x_hot 0
: #define PalmFont0_y_hot 0
: static unsigned char PalmFont0_bits[] = {
: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
: 0x00,
: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
: 0x00,
: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
: 0x00,
: ... and so on...
:
: In X11, the code to load it looks like:
:
: palmFontBitmap = XCreateBitmapFromData(display, rootWindow,
: (char *)PalmFont0_bits,
: PalmFont0_width, PalmFont0_height);
:
: I figured in NanoX it should look something like this:
:
: palmFontBitmap = GrNewPixmap(PalmFont0_width, PalmFont0_height, (void
: *) NULL);
:
: GrBitmap(palmFontBitmap, gcNormal, 0,0,
: PalmFont0_width, PalmFont0_height,
: (GR_BITMAP *) PalmFont0_bits);
:
:
: To actually make use of sections of it I do the following:
:
: GrCopyArea(paintWindow, gc,
: x, y,
: end-start, PalmFont0_height,
: palmFontBitmap,
: start, 0,
: MWROP_SRCCOPY);
:
:
:
: --
: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
: = Robert Hartley Mail: 201 Broadway =
: = Central Region Systems Engineer Cambridge, MA 02139 =
: = Integrated Computer Email: ####@####.#### =
: = Solutions, Inc. Web Site: www.ics.com =
: = Tech Support: ####@####.#### Phone: 800-800-4271 =
: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
:
: Visit the MotifZone (www.motifzone.org) for info on Motif!
:
:
:
:
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: ####@####.####
: For additional commands, e-mail: ####@####.####
: