Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I want to display an image...

Posted on 2004-09-07
11
Medium Priority
?
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1400 total points
ID: 12000560
xsetbg -onroot -at X,Y file
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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
 
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 600 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

609 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