Solved

I want to display an image...

Posted on 2004-09-07
11
278 Views
Last Modified: 2010-04-22
Hello guys,

I want to display an Image, command line, on my root window, on a certain place, scaled to a certain width and height. The application should stop after displaying it and the image should stay there on the root window.
I used xv, but I get into trouble. You can display an image on your root window, but when you do, it ignores your geometry and uses the rmode parameter which forces you into tiling or centering or.. but not what I want.

I need this to draw an initial background on the start of my program but then the program should exit so that my processs continues.
I work on a stripped version of red hat (due to lack of space) , I have xloadImage and xv on my system. the command is executed by a 'system()' call in the source.

thnx!
0
Comment
Question by:themuppeteer
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11999626
xsetroot
0
 
LVL 2

Expert Comment

by:sneeuw_chan
ID: 12000420
Does xsetroot do what the OP requires (I.E. setting a single image at given coordinates) ?

AFAIK, you can't set part of the root background, you can only set the whole root at once.   If the image you supply is too small, it gets repeated (tiled, that is).  So if you don't want the upper left corner to be the upper left corner of your screen, and you don't want the image to repeat to the lower right, you're going to have to add borders to the image.

Do you have imlib on your computer ?  If so, I have a pretty small program I wrote years ago to set the background with.  It doesn't do black borders, but I'm sure that's relatively easy to add.  (If it compiles against the current imlib, that is...)

If you don't have imlib or another library to handle images, getting images into the right form to put in a window is a pretty big task in itself.
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 350 total points
ID: 12000560
xsetbg -onroot -at X,Y file
0
 
LVL 1

Expert Comment

by:gethemant
ID: 12026196
xsri
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12052264
Thanks for the input guys,
but so far nothing did the trick. I'm talking an image on ROOT window here. On x,y,w,h.
I still have to try xsri. I'll post again once I have more info.

grtz
themuppeteer
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 12053059
what is the problem with xsetbg?
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12053222
Hello ahoffman,
The problem with xsetbg is that it doesn't scale.

and the problem with xsri is that it is not present on the system. But I'll test it anyway and if it does what it has to do (x,y, width and height) then I might put it on the system.
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12054402
how do you get xsri on you r root window ? it only works on another then your root window.
0
 
LVL 2

Accepted Solution

by:
sneeuw_chan earned 150 total points
ID: 12063376
xsetbg has a -zoom option.
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 12063874
yes indeed,that together with the border option get the job done.

(fyi /usr/X11R6/bin/xsetbg -display :0 -border black -onroot -at 96,160 -zoom 16 myimage.gif )



Thanks Guys, I'll split the points, 350 for ahoffman and 150 for sneeuw chan for making me look better to the zoom option. hope everybody is satisfied then ;)


Thanks a lot!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 12064392
well done! themuppeteer understands EE's grading schema
Thanks and enjoy your pictures.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Optimize bash script 20 458
File system unmounted 3 155
GUI development for Ubuntu 8 215
Linux "time" command output redirection 16 121
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now