LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-30-2005, 04:41 PM   #1
dtcs
LQ Newbie
 
Registered: Jul 2005
Distribution: Slackware, Debian
Posts: 28

Rep: Reputation: 15
Xlib how to import picture


I am trying to add a picture to my xlib program, any idea how to do that and what formats are supported?

Code:
Display *display;
Window root_win=RootWindow(display,DefaultScreen(display));

Pixmap my_bmp;
int xh_bmp,yh_bmp;
unsigned int w_bmp,h_bmp;

if(XReadBitmapFile(display,root_win,"f1.xbm",&w_bmp,&h_bmp,&my_bmp,&xh_bmp,&yh_bmp)!=BitmapSuccess){
                fprintf(stderr,"Failed to read bitmap file\n");
                exit(0);
}
This code always displays "Failed to read bitmap file"
 
Old 08-02-2005, 01:44 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The only format guarantted to be supported is the X11 bitmap format, the one you got with XWriteBitmapFile. Other formats may be supported, but are O/S dependant.

What is the precise XReadBitmapFile return value ?
- BitmapOpenFailed
- BitmapFileInvalid
- BitmapNoMemory
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Linux - Newbie 12 11-27-2018 01:30 PM
Import sys ?bash: import: command not found joirnange Linux - Newbie 4 12-28-2004 10:33 PM
Creating CVS repository: cvs [import aborted]: attempt to import the repository enemorales Linux - Software 3 10-15-2004 04:30 PM
Xlib: connection to ":0.0" refused by server Xlib: No protocol specified eyalkz Programming 1 03-02-2004 08:22 AM
Xlib help what to do? micxz Linux - General 4 03-10-2003 01:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration