Solved

I want to display an image...

Posted on 2004-09-07
11
277 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

13 Experts available now in Live!

Get 1:1 Help Now