[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

1420.0. "Using a 24 bit firefox and 8 bit images..." by GPSDCC::ZGRAGGEN (Searching for infinity...) Tue Sep 12 1989 05:37

    Hi,
    
    I'm trying to put an 8-bit deep image in an 8-bit deep pixmap on and
    24-bit deep firefox. But, all I get is a BadMatch on XPutImage.
    
    What I do is get the 8-bit deep PseudoColor visual. Using this visual I
    create a private colormap. I create a window (child of root) of depth 8
    with the PseudoColor visual, my private colormap, with border pixel and
    background pixel defines as the WhitePixel. Then I create a pixmap
    (XCreatePixmap), using my window as the drawable argument and a depth
    of 8. Then I create a image (ZPixmap) of depth 8 using the PseudoColor
    visual. I then use XPutImage into the pixmap, the GC being used is
    supplied by XCreateGC and uses the default values.
    
    The XPutImage generates a BadMatch, does anyone have any ideas or is
    this a bug (if so I'll QAR). 
    
    Thanks,
    	Peter
    
    P.S.
    	I can get the image displayed if I convert the image to 32-bits,
    use the DirectColor visual at 24-bits, this works. But wastes a hell of
    a lot of resources! The PMAX runs the same program about 10 times
    faster.

T.RTitleUserPersonal
Name
DateLines
1420.1IdeasDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Tue Sep 12 1989 11:2420
A couple suggestions, not all of which address the current problem:

1.  WhitePixel is only valid on the default colormap.  Thus your background
and border are undefined.  Allocate a white out of your new colormap.  (This
does not cause a match problem; only a possible strange color);

2.  Make sure you are creating the GC with the correct window.  When you say
"default values" I assume you are still using your new window, not the
default window, right?

3.  Use the debugger and look at the XImage structure.  It may be getting
initialized to something that is not appropriate for the non-default visual.
I just looked at the structure, and could not see anything offhand, but
I may have missed something.

Hope this helps.  If not, try experiments using the same gc to do something
else (like a line) to the pixmap, and try XYPixmap, etc.

Burns

1420.2GC was the problem...GPSDCC::ZGRAGGENSearching for infinity...Tue Sep 12 1989 13:519
    Well, it is point 2 that solved the problem! The XImage struct has some
    real funnies in it, but getting the GC on the RIGHT window (not the
    root window) fixed the problems!
    
    I'll buy you a beer if you're ever in Geneva!
    
    Thanks,
    	Peter

1420.3Beer in Geneva...what a deal!DECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Wed Sep 13 1989 12:496
Sounds like a good deal.  There must be some good reason for me to go there.
(Haven't been to Geneva since (gulp!) 1968 when I went on a high school
student exchange thing!

Burns