Hi all,
                Is there anyone familiar with the use of xloadimage/xsetbg who 
can 
give me a hint as to why I can't load a small image with a transparent 
background image onto an existing background image.
In the following bash shell function, virgin.jpg is intended to cover the 
whole background, with one.jpg and two.gif being smaller images (edited with 
the GIMP) with transparent backgrounds.
I can't seem to load an image with a transparent background onto an existing 
root window with the transparent bit showing the original background image - 
the transparent bits of one.jpg and two.gif always show white.

TIA for any assistance/suggestions

Andy
----------------------------------------------------------->% 

 
dologo() {
        BACK="images/virgin.jpg"
        LOGO="images/one.jpg"
        COPYRIGHT="images/two.gif"
# Get the root window size
        set `xwininfo -root | grep Width`
        shift
        width=$1
        set `xwininfo -root | grep Height`
        shift
        height=$1
        echo "screen is $width X $height"

# Get the correct zoom factor
        xzoom=`expr $width \* 100`
#  1280 is the X resolution of BACK
        xzoom=`expr $xzoom \/ 1280`
        yzoom=`expr $height \* 100`
#  1024 is the Y resolution of BACK
        yzoom=`expr $yzoom \/ 1024`

        echo "xzoom=$xzoom yzoom=$yzoom"

# Set the positions of the COPYRIGHT and LOGO
#       copyright_x=`expr $width - 400`
        copyright_x=`expr $width - 350`
        copyright_y=`expr $height - 40`
#       logo_x=`expr $width - 200`
        logo_x=`expr $width - 150`
        logo_y=`expr $height - 100`

# Blat the background

        xloadimage -fullscreen -onroot -xzoom $xzoom -yzoom $yzoom ${BACK} -
merge -at $logo_x,$logo_y ${LOGO} -merge -at $copyright_x,$copyright_y 
${COPYRIGHT}

}

----------------------------------------------------------->% 

-- 
Andy Paterson

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2010-11-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to