[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

1741.0. "Create pixmap for label widget via PAINT" by COMICS::FISCHER (Ian Fischer - UK Workstation Support) Wed Nov 15 1989 11:22

I've cross-posted this into the Programming and Documentation notesfiles.
    
    
In the VMS DECwindows Guide to Application Programming manual, it says on p5-5 
(section 5.2.1.4) that...

	" You can create a pixmap in the following three ways:

	.........	
	
	o Use the DECpaint application, described in the VMS DECwindows 
	  Desktop Applications Guide. "

Is there anywhere where it actually says *how* this is done?

Any help/pointers would be greatly appreciated.


Ian
    
T.RTitleUserPersonal
Name
DateLines
1741.1VIA::FINNEGANAll of the best intentions are less than one good act.Thu Nov 16 1989 16:3438
Run paint
Use the Customize Picture Size... option and choose non-standard from the
option menu and set the width and height to the size of the bitmap you want to
create.

Use paint to create the picture, I like to use zoom mode to handle the detail
work.

Save the picture as an X11 file (not a DDIF file.)

The X11 files C include that can be used for the data, width and height in the
XCreatePixmapFromBitmapData call.

#define clock_width 32
#define clock_height 32
#define clock_x_hot 0
#define clock_y_hot 0
static char clock_bits[] = {
   0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xfd, 0xff, 0xff, 0xbf,
   0x05, 0x00, 0x00, 0xa0, 0x05, 0xc0, 0x01, 0xa0, 0x05, 0xc0, 0x01, 0xa0,
   0x05, 0xc0, 0x01, 0xa0, 0x05, 0x0c, 0x18, 0xa0, 0x05, 0x0c, 0x18, 0xa0,
   0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x00, 0xa0, 0x85, 0x01, 0xb0, 0xa1,
   0x85, 0x01, 0x98, 0xa1, 0x05, 0x18, 0x0c, 0xa0, 0x05, 0x30, 0x06, 0xa0,
   0x75, 0x60, 0x03, 0xae, 0x75, 0xc0, 0x01, 0xae, 0x75, 0x80, 0x00, 0xae,
   0x05, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x80, 0xa1, 0x85, 0x01, 0x80, 0xa1,
   0x85, 0x01, 0x00, 0xa0, 0x05, 0x00, 0x00, 0xa0, 0x05, 0x0c, 0x18, 0xa0,
   0x05, 0x0c, 0x18, 0xa0, 0x05, 0xc0, 0x01, 0xa0, 0x05, 0xc0, 0x01, 0xa0,
   0x05, 0xc0, 0x01, 0xa0, 0x05, 0x00, 0x00, 0xa0, 0xfd, 0xff, 0xff, 0xbf,
   0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff};

    Pixmap pid;
    ScreenNumber = XDefaultScreen (dpy);

    pid = XCreatePixmapFromBitmapData (dpy, root, clock_bits,
                (Dimension) clock_width, (Dimension) clock_height,
                (unsigned long) BlackPixel (dpy, ScreenNumber),
                (unsigned long) WhitePixel (dpy, ScreenNumber),
                (unsigned int) DefaultDepth (dpy, ScreenNumber));
1741.2OK if using C, but...COMICS::FISCHERIan Fischer - UK Workstation SupportFri Nov 17 1989 10:184
    OK Thanks, but what about using Pascal instead of C. Is it possible???
    
    
    Ian
1741.3MELTIN::dickGvriel::SchoellerFri Nov 17 1989 11:366
You can do it though only at run time.  You use, XReadBitmapFile to get
the bitmap instead of XCreateBitmapFromData.  This is somewhat slower
than doing it at compile time but still works.


Dick