Re: XForms: Show a BMP picture in Xwindow

Stefano Incontri (stefano.in@iol.it)
Wed, 16 Sep 1998 22:12:54 +0200

# To subscribers of the xforms list from Stefano Incontri <stefano.in@iol.it> :

Saulo Popov Zambiasi wrote:

> # To subscribers of the xforms list from Saulo Popov Zambiasi <saulopz@cco.matrix.com.br> :
>
> Hi all, I'm beginner with Xwindow programming.
> I'm work with BMP in Xwindow, I build the library to read/write
> BMP file format, but now I need show it in X screen. As I don't know how
> do in Xwindow, I was thinkking in a function that display a pixel in
> screen and to use a loopping in this function to show all picture.
> Example:
> ________________________
> imageidx = 0;
> for (column=0; column<width; column++){
> for(line=0; y<line; line++){
> X_put_pixel_in_screen(column, line, image->red, image->gren, image->blue);
> imageidx++;
> }
> }
> _______________________
> Can you understand me? I will be very happy if anywhere can help me...
>
> Thanks...
>

BMP in XWindows has a 1 bit color depth, or black&white if you prefer.I think you'd be better
to use XPM format, converting the BMP files you have in XPM.
Then, you could use the Xpm library (look at the include file under /usr/include/X11/xpm.h)
that is very complete.

I hope have been of help!

Stefano

> ---------------------------------------------------------------------
> Saulo Popov Zambiasi | /cgi-bin/exit-to?http://cco.matrix.com.br/saulopz/
> Rua Mal. Candido Rondom, 1016-E | saulopz@cco.matrix.com.br
> Cep 89806-060 - Fone 049 723-4993 | ICQ UIN: 1318716
> Chapeco - Santa Catarina - Brasil | UNOESC - Ciencias da Computacao
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuf2.usuhs.mil or see
> http://bob.usuf2.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/