[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2675.0. "Monochrome vs Color" by HKOVC::TERENCE (From Middlesex, UWO) Fri Apr 27 1990 08:29

    Could anybody tell me why the following code works in a VMS 5.4
    monochrome VAXstation 2000 but not in a VMS 5.2 color GPX?
    
    Thanx in advance
    
    -Terry
    
    #define WIDTH 74
    #define HEIGHT 57
    
    Pixmap pix;
    XImage *xi;
    
    ...
    
    pix = XCreatePixmap(...
    gc = XCreateGC(...
    xi = XCreateImage(dpy,XDefaultVisualOfScreen(scr),
    	XDefaultDepthOfScreen(scr),XYBitmap,0,data,WIDTH,HEIGHT,8,10);
    XPutImage(dpy,pix,gc,xi,0,0,x,y,WIDTH,HEIGHT);
T.RTitleUserPersonal
Name
DateLines
2675.1PSW::WINALSKICareful with that VAX, EugeneFri Apr 27 1990 19:338
Probably because there's a visual depth mismatch.  On a monochrome system,
everything is going to have a depth of 1.  On a color system, bitmaps still
have a depth of 1, but the default visual depth is 8.  You didn't show us the
pixmap and gc parameters, so it's hard to tell from your code fragment.
The fact that your XCreateImage call says XYBitmap rather than XYPixmap format
is suspicious.

--PSW
2675.2more ...HKOVC::TERENCEFrom Middlesex, UWOTue May 01 1990 04:4413
    Re: -1
    
    I have
    	gc.foreground = BlackPixelOfScreen(...
    	gc.background = WhitePixelOfScreen(...
    
    How does X treat the 1's and 0's in a Bitmap/Pixmap? If I specify
    XYPixmap in the XCreateImage call, I got the image printed in reverse
    video. Why?
    
    Thanx
    
    -Terry
2675.3It's kind of like CopyPlane vs CopyAreaDECWIN::FISHERPrune Juice: A Warrior's Drink!Tue May 01 1990 20:348
If you specify XYPixmap, the bits you give it are copied into the pixmap.  If
you say XYBitmap, the bits you pass in are used as selectors.  A 1 will put
the foreground color into the pixmap; a 0 will put the background color.

Note that you can do a PutImage of a 1-bit deep image into a multi-deep pixmap
that way.  In fact, the image you specify *must* be 1 deep for XYBitmap.

Burns
2675.4more ...HKOVC::TERENCEFrom Middlesex, UWOWed May 02 1990 03:5012
    1) When I create a Pixmap, will all the planes be automatically filled
       up with 0's?
    2) A XYPixmap's 0 means black and a XYBitmap's 0 means background
       color?
    3) What happens if I XCreateImage with depth > 1 and the image data
       only has depth 1?
    4) What happens if I XPutImage such an image into a Pixmap of depth >
       1?
    
    Thanx a lot
    
    -Terry
2675.5RTXBDECWIN::KLEINWed May 02 1990 18:4216
>    1) When I create a Pixmap, will all the planes be automatically filled
>       up with 0's?

	"The initial contents of the pixmap are undefined." (page 93)

>    2) A XYPixmap's 0 means black and a XYBitmap's 0 means background
>       color?

	Neither.  I think it just means "0", the value of which depends
	on the colormap used when the pixmap is displayed.

I'm not sure about (3) and (4), but I'm sure the answers are somewhere in
"X Window System" (Scheifler, et. al.).  If you don't have this book,
you should go out TODAY and get it!

-steve-
2675.6Read this while on the bus to get the book...DECWIN::FISHERPrune Juice: A Warrior's Drink!Wed May 02 1990 21:1922
    2) A XYPixmap's 0 means black and a XYBitmap's 0 means background
       color?
    
    ***Steve is right about XYPixmap.  0 means display a pixel value of 0.
    ***This may be black, but don't count on it.  You HAVE to have any
    ***pixel values you use defined in the colormap.
    ***You are correct about XYBitmap's 0 meaning background.
    
    3) What happens if I XCreateImage with depth > 1 and the image data
       only has depth 1?
    
    ***XCreateImage is a routine which creates a data structure which
    describes the image data.  If you tell it depth >1 and the data is
    really only 1, you have a broken descriptor.  X will act as though
    the data is deep, but since it is not, you will probably get a mush
    of garbage on the screen (if anything).
    4) What happens if I XPutImage such an image into a Pixmap of depth >
       1?
    ****See .3.
    
    ****Burns
    
2675.7more on "X Window System"HKOVC::TERENCEFrom Middlesex, UWOThu May 03 1990 01:156
    Could you guys give me detail about the book? Like which publisher,
    what edition, and what order number?
    
    Thanx
    
    -Terry
2675.8Scheifler, Gettys and NewmanKOBAL::SCHOELLERSchoeller - Failed XperimentThu May 03 1990 02:3315
I am sitting at home so I don't have the order number but, the book is

The X Window System - C Language Reference and Protocol Manual
Scheifler, Gettys and Newman
Digital Press

Since we publish it, you can get a really cheap price internally.  If you
need it quick you may have to buy it from a bookstore (perhaps at a local
university).

This is the big maroon, paperback book with the X logo on the cover.  The
authors were the original developers of X (Scheifler is still with the X
Consortium). It is therefore quite authoritative.

Dick
2675.9Book info...GSRC::WESTVariables don't, Constants aren'tThu May 03 1990 13:5019
  X Window System: C Library and Protocol Reference
  Digital Press
  Order Number : EY-6737E-DP
  ISBN : 1-55558-012-2

  About $27.50 + tax for Digital employees.


  Another highly recommended book is

  "Introduction to the X Window System"
  Oliver Jones
  Prentice-Hall
  ISBN : 0-13-499997-5


						-=> Jim <=-

2675.10How to order?HKOVC::TERENCEFrom Middlesex, UWOFri May 04 1990 07:394
    Sorry, but one more question. How can I order it? Can I order it by
    EMail?
    
    -Terry
2675.11here's my story...GSRC::WESTVariables don't, Constants aren'tMon May 07 1990 00:0823
  I'm not sure about E-mail.  I just sent them a check and they sent me the
book.  I bought it as a Digital employee and not a cost center.

  You will probably need to call them to find out the current price of the
book.  Since you are a Digital employee, you get the book for 50% of the
cover price.  The tax you add depends on your locale.  Here in Colorado
Springs the tax is 6.7%, so this is what I had to add to the price of the
book.

  I apologize, but I don't have their number or address handy.  Maybe someone
else does.

  If you can get your cost center to buy the book, then the procedure is the
same as ordering any documentation.  This way, however, seems to take longer.
I received my book in about 10 days via UPS after placement of order.

As for the "Introduction to..." book, any _good_ bookstore should either have
it or can order it for you.  I think's it's price was somewhere between $25
and $30.

						-=> Jim <=-