Xref: utzoo comp.windows.x:29372 comp.windows.x.motif:1159 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!mcnc!gatech!prism!gt2245a From: gt2245a@prism.gatech.EDU (KUAI, WENMING) Newsgroups: comp.windows.x,comp.windows.x.motif Subject: Bitmap => XImage => Widget Keywords: Help Message-ID: <16866@hydra.gatech.EDU> Date: 11 Nov 90 22:59:45 GMT Followup-To: comp.windows.x Organization: Georgia Institute of Technology Lines: 53 The following is a short program that was expected to show a bitmap image. / o-----------o -o ------ o/ / \ \ / / / / / o -o The left is what I created using bitmap, but the right is what I actually get(sort of). Could someone out there please give me some advice as what my mistake is? Your help will be greatly appreciated. William P.S. simplenet is a file containing an array of bits representing the image(100x100). ====================================================== #define BYTES_PER_LINE 13 #include #include #include #include #include "simplenet" main(argc, argv) int argc; char *argv[]; { Widget toplevel, welcome, demo, options; Arg wargs[1]; char *message; XImage *image; toplevel = XtInitialize(argv[0], "NNGinit", NULL, 0, &argc, argv); image = XCreateImage(XtDisplay(toplevel), DefaultVisualOfScreen(XtScreen(toplevel)), 1, XYBitmap, 0, image_bits, image_width, image_height, 8, BYTES_PER_LINE); XtSetArg(wargs[0], XtNsRimage, image); XtCreateManagedWidget("Demo", XwsrasterWidgetClass, toplevel, wargs, 1); XtRealizeWidget(toplevel); XtMainLoop(); }