home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!munnari.oz.au!metro!sunb!macnab!s8923098
- From: s8923098@macnab.mqcs.mq.oz.au (Josef WIDJAJA)
- Subject: Re: XPutPixel and and XGetPixel and image layout
- Message-ID: <1992Sep10.023821.12479@mailhost.ocs.mq.edu.au>
- Sender: news@mailhost.ocs.mq.edu.au (Macquarie University News)
- Nntp-Posting-Host: macnab.mpce.mq.edu.au
- Organization: Macquarie University, School of Mathematics, Physics, Computing and Electronics
- References: <VICTOR.92Aug31135453@terse4.watson.ibm.com> <1992Sep4.085202.17533@thunder.mcrcim.mcgill.edu> <1992Sep9.130723.9938@city.cs>
- Date: Thu, 10 Sep 1992 02:38:21 GMT
- Lines: 43
-
- In article <1992Sep9.130723.9938@city.cs> lionel@cs.city.ac.uk (Lionel Tun) writes:
- |Re: The discussion about using images directly rather than going
- | through XPutPixel.
- |
- |I also would like to simply load the raw data into an array and
- |display it in a window - simple no?
- |
- |I tried the following but got structured garbage instead of my
- |graphic:
- |
- | xi = XCreateImage(display, DefaultVisual(display, screen_num),
- | 1, XYBitmap, 0, image, width, height, 8, 0);
- ^^^^^
- Make sure image is a pointer to or an array of char. I personally
- think that it can be easily confused with a pointer to XImage.
-
-
- |
- | XPutImage(display, win, gc, xi, 0,0, 0,0, width, height);
- ^^^^
-
- Before you do XPutImage you will want to assign xi->data to point
- to image. You should have:
-
- xi->data = image;
- XPutImage(....etc...);
-
- Other than that, I can't see anything wrong with your code. The fact
- that you got 'structured' garbage probably indicates that there is nothing
- wrong with your code above, you probably did not manipulate the image data
- correctly.
-
-
- |
- |image is an array holding the data
- |the platform is a b+w Sun 4 running OpenWindows
- |
-
- --
- _________Josef Widjaja____________
- | s8923098@mackay.mpce.mq.edu.au |
- | Macquarie University, Australia |
- |__________________________________|
-