🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #37754

Re: problems with R4 "bitmap" to construct Xview icons

#37754
From: Heather Rose
Date: Wed, 07 Mar 1990 01:29
59 lines
2194 bytes
In article <541@med.Stanford.EDU> rick@hanauma (Richard Ottolini) writes:
>
>The bits within a byte are reversed when the output file of bitmap
>is the value of SERVER_IMAGE_BITS for an Xview icon.
>This is on a SPARC.
>Any suggestion for getting the bits in the right order
>without having to reverse them in my code?

When using an X11 bitmap, use the attribute SERVER_IMAGE_X_BITS to create
the image.  I noticed that this attribute was not documented in the O'Reilly
manual.  Here's an example using an X11 bitmap as an icon image:

#include "icon.bm"

...
        Icon            icon;
        Server_image    icon_image;

	icon_image = (Server_image)xv_create(XV_NULL, SERVER_IMAGE,
                XV_WIDTH,               icon_width,
                XV_HEIGHT,              icon_height,
                SERVER_IMAGE_X_BITS,    icon_bits,
                NULL);

        icon = (Icon)xv_create(obj, ICON,
                ICON_IMAGE,     icon_image,
                NULL);
 
        xv_set(obj, FRAME_ICON, icon, NULL);

If you use SunView formatted icons, the same code would look very similar,
just use the attribute SERVER_IMAGE_BITS instead.  

Here's an example using a SunView style icon:

short open_bits[] =  {
#include "open.icon"
};

...

    Server_image        open_image;
    Icon                icon;

    open_image = (Server_image)xv_create(NULL, SERVER_IMAGE,
        XV_WIDTH,               64,
        XV_HEIGHT,              64,
        SERVER_IMAGE_BITS,      open_bits,
        NULL);

    icon = (Icon)xv_create(frame, ICON,
        ICON_IMAGE,             open_image,
	NULL);

    xv_set(obj, FRAME_ICON, icon, NULL);

Regards,

Heather
Technical Details
Message-ID: <132603@sun.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!texsun!newstop!sun!kimba!hvr
References: <541@med.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!texbell!texsun!newstop!sun!kimba!hvr
From: hvr@kimba.Sun.COM (Heather Rose)
Newsgroups: comp.windows.x
Subject: Re: problems with R4 "bitmap" to construct Xview icons
Message-ID: <132603@sun.Eng.Sun.COM>
Date: 7 Mar 90 01:29:02 GMT
References: <541@med.Stanford.EDU>
Sender: news@sun.Eng.Sun.COM
Reply-To: hvr@sun.UUCP (Heather Rose)
Organization: Sun Microsystems, Mountain View
Lines: 59