Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Art & Imaging in Linux
Reload this Page Drawing RAW image to X-Window
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Art & Imaging in Linux Stuff made with The GIMP and/or others

Reply
 
Thread Tools Display Modes
Old 07-20-2006   #1 (permalink)
Just Joined!
 
Join Date: Jul 2006
Posts: 6
Red face Drawing RAW image to X-Window

Hello,
I want to draw image on an X-Window. This will be so simple than reading a Jpeg file and drawing it I guess. Here is what I need:

I have completely RAW images. Think of it as a matrix of any size, for example size=4x4 and the image is like this:

10 125 43 157
99 45 182 84
59 168 39 65
16 67 154 27

That is, the values are from 0 to 255, so they represent graylevels. (No color is involved.) Of course, the above is a simple example; I'll work on images of larger sizes.

I have compiled the simple programs at this address. I want to modify them according to my needs and I know that, I need to work with XImage, XCreateImage and related functions but I don't know how to do it.

For example, one program uses the function

int rc = XReadBitmapFile(display, win,
"icon.bmp",
&bitmap_width, &bitmap_height,
&bitmap,
&hotspot_x, &hotspot_y);

and reads and displays a BMP image BUT I only want to display the values of a matrix MyImage[i][j], where i=j= 1 to 4 for above matrix.

Would any one help me on how to use the X library functions with examples if possible?
Thanks a lot!!
hcengiz is offline   Reply With Quote
Old 07-20-2006   #2 (permalink)
Linux Engineer
 
Javasnob's Avatar
 
Join Date: Jul 2005
Location: Wisconsin
Posts: 942
If you don't mind using a third-party library, I highly recommend Imlib2. It's fast and efficient, plus it's easy to use. It's alot better than dealing with Xlib's image manipulation routines, in my opinion.
__________________
Flies of a particular kind, i.e. time-flies, are fond of an arrow.

Registered Linux User #408794
Javasnob is offline   Reply With Quote
Old 07-21-2006   #3 (permalink)
Just Joined!
 
Join Date: Jul 2006
Posts: 6
Wink How to use the functions to display?

Well, thanks for the valuable ideas.
Would anyone give me some idea how to go with either Xlib or Imlib2?

Like, read the file like this, using this function and display it using this function.

Thanks.
hcengiz is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 02:47 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0