Placing controls on top of a background image

Hello folks:
Need a bit of help please. Need to be able to display a .gif image (800x600)as a background, with controls such as Labels and textboxes on top of the image. Is there away to do this with the various panes in Swing, and if so how, or is there a better way. If y'all have a bit of sample code to share it sure would be appreciated.
Thanks for the help and advise in advance - Bart

Here are two ways to do it:
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class TestBackground extends JFrame
     ImageIcon img;
     public TestBackground()
          img = new ImageIcon("????.jpg");
          JPanel panel = new JPanel()
               public void paintComponent(Graphics g)
                    g.drawImage(img.getImage(), 0, 0, null);
                    super.paintComponent(g);
          panel.setOpaque(false);
          panel.add( new JButton( "Hello" ) );
          setContentPane( panel );
     public static void main(String [] args)
          TestBackground frame = new TestBackground();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(300, 300);
          frame.setVisible(true);
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class TestBackgroundLayered extends JFrame
     public TestBackgroundLayered()
          ImageIcon image = new ImageIcon("????.jpg");
          System.out.println(image.getImageLoadStatus());
          System.out.println(image.getIconHeight());
          JLabel background = new JLabel(image);
          background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
          getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
          JPanel panel = new JPanel();
          panel.setOpaque(false);
          panel.add( new JButton( "Hello" ) );
          setContentPane( panel );
     public static void main(String [] args)
          TestBackgroundLayered frame = new TestBackgroundLayered();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(300, 300);
          frame.setVisible(true);
}

Similar Messages

  • Problem placing buttons on top of a background image

    My knowledge of Java isn't the greatest and I am currently having problems placing buttons on top of a background image within a JApplet (this is also my first encounter with Applets).
    I'm using a Card Layout in order to display a series of different screens upon request.
    The first card is used as a Splash Screen which is displayed for 5 seconds before changing to the Main Menu card.
    When the Main Menu card is called the background image is not shown but the button is.
    While the Applet is running no errors are shown in the console.
    Full source code can be seen below;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.net.*;
    // First extend JApplet
    public class WOT extends JApplet {
         //--------------- Variables are declared here -----------------
         private CardLayout contentCardLayout = new CardLayout();  // declare CardLayout
         private Container contentContain;     // declare content Container
         private JPanel contentCard, splashScreen, mainMenu, menuImage; // declare content Panels
         private JLabel splash, menu, map; // declare image labels
         private ImageIcon mapBtn; // declare ImageIcons
         private JButton mapOption; // declare option Buttons
         private Timer timer; // declare Timer
         private ActionListener actionListener, mapOptionListener; // declare ActionListener
    //--------------- Initialise Applet -----------------
      public void init() {
         //--------------- Set-up Card Layout -----------------
         contentCard = new JPanel(contentCardLayout); // assign card panels to CardLayout
         //--------------- Splash Screen -----------------
         splashScreen = new JPanel();
         splash = new JLabel(new ImageIcon(getClass().getResource("img/bg.gif")));
         splashScreen.add(splash);
         splashScreen.setSize(600,800);
         splashScreen.setLocation(0,0);
    //--------------- "View Map" Option Button -----------------
         mapBtn = new ImageIcon(getClass().getResource("img/map.gif"));
         mapOption = new JButton(mapBtn);
         mapOption.setBorder(null);
         mapOption.setContentAreaFilled(false);
         mapOption.setSize(150,66);
         mapOption.setLocation(150,450);
         mapOption.setOpaque(false);
         mapOption.setVisible(true);
    //--------------- Main Menu Screen -----------------
         //menuImage = new JPanel(null);
         //menuImage.add(mainMenu);
         //menuImage.setLocation(0,0);
         mainMenu = new JPanel(null);
         menu = new JLabel(new ImageIcon(getClass().getResource("img/menu.gif")));
         menu.setLocation(0,0);
         mainMenu.add(menu);
         //mainMenu.setBackground(Color.WHITE);
         mainMenu.setLocation(0,0);
         mainMenu.setOpaque(false);
         //mainMenu.setSize(150,66);
         mainMenu.add(mapOption);
         //--------------- Map Image Screen -----------------
         map = new JLabel(new ImageIcon(getClass().getResource("img/map.gif")));
         //--------------- Add Cards to CardLayout Panel -----------------
        contentCard.add(splashScreen, "Splash Screen");
         contentCard.add(mainMenu, "Main Menu");
         contentCard.add(map, "Map Image");
    //--------------- Set-up container -----------------
          contentContain = getContentPane(); // set container as content pane
          contentContain.setBackground(Color.WHITE); // set container background colour
           contentContain.setLocation(0,0);
           contentContain.setSize(600,800);
          contentContain.setLayout(new FlowLayout()); // set container layout
           contentContain.add(contentCard);  // cards added
           //--------------- Timer Action Listener -----------------
           actionListener = new ActionListener()
                    public void actionPerformed(ActionEvent actionEvent)
                             //--------------- Show Main Menu Card -----------------
                             contentCardLayout.show(contentCard, "Main Menu");
         //--------------- Map Option Button Action Listener -----------------
           mapOptionListener = new ActionListener()
                    public void actionPerformed(ActionEvent actionEvent)
                             //--------------- Show Main Menu Card -----------------
                             contentCardLayout.show(contentCard, "Map Image");
         //--------------- Timer -----------------               
         timer = new Timer(5000, actionListener);
         timer.start();
         timer.setRepeats(false);
    }Any help would be much appreciated!
    Edited by: bex1984 on May 18, 2008 6:31 AM

    1) When posting here, please use fewer comments. The comments that you have don't help folks who know Java read and understand your program and in fact hinder this ability, which makes it less likely that someone will in fact read your code and help you -- something you definitely don't want to have happen! Instead, strive to make your variable and method names as logical and self-commenting as possible, and use comments judiciously and a bit more sparingly.
    2) Try to use more methods and even classes to "divide and conquer".
    3) To create a panel with a background image that can hold buttons and such, you should create an object that overrides JPanel and has a paintComponent override method within it that draws your image using the graphics object's drawImage(...) method
    For instance:
    an image jpanel:
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import java.net.URISyntaxException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class BackgroundImage
        // **** this will have to be changed for your program:
        private static final String IMAGE_PATH = "../../m02/a/images/Forest.jpg";
        private BufferedImage myImage = null;
        private JPanel imagePanel = new JPanel()
            @Override
            protected void paintComponent(Graphics g)
            {   // *** here is where I draw my image
                super.paintComponent(g);  // **** don't forget this!
                if (myImage != null)
                    g.drawImage(myImage, 0, 0, this);
        public BackgroundImage()
            imagePanel.setPreferredSize(new Dimension(600, 450));
            imagePanel.add(new JButton("Foobars Rule!"));
            try
                myImage = createImage(IMAGE_PATH);
            catch (IOException e)
                e.printStackTrace();
            catch (URISyntaxException e)
                e.printStackTrace();
        private BufferedImage createImage(String path) throws IOException,
                URISyntaxException
            URL imageURL = getClass().getResource(path);
            if (imageURL != null)
                return ImageIO.read(new File(imageURL.toURI()));
            else
                return null;
        public JPanel getImagePanel()
            return imagePanel;
    }and an applet that uses it:
    import java.lang.reflect.InvocationTargetException;
    import javax.swing.JApplet;
    import javax.swing.SwingUtilities;
    public class BackgrndImageApplet extends JApplet
        @Override
        public void init()
            try
                SwingUtilities.invokeAndWait(new Runnable()
                    @Override
                    public void run()
                        getContentPane().add(new BackgroundImage().getImagePanel());
            catch (InterruptedException e)
                e.printStackTrace();
            catch (InvocationTargetException e)
                e.printStackTrace();
    }

  • How can I put a vertical menu ON TOP OF the background image?

    I've taken a screenshot to describe my problem.
    http://i48.tinypic.com/10ndeg4.jpg
    I want to put the menu on top of the background image. Compare it to placing another image on top of the background image. HOW on earth can I do this?

    Did you try putting the image in a <div> and setting the background image for the <div> with CSS.  Then within the <div> place your menu.
    Just a thought.
    LJD

  • Inserting a Spry Accordion on top of a background image?

    I created an 800 x 600 pixel graphic image in Adobe Photoshop CS4 to be used as an overall background image for a webpage.  I also created a few navigation links from the image Layers using the Slice Select Tool, then optimized and saved the image as an html file using the Save for Web & Devices command in Photoshop.  Next, I opened the html file in Dreamweaver CS4.  
    Is it possible to insert a Spry Accordion with a clear (transparent) background anywhere on top of that background image in Dreamweaver CS4 so that I can see the background image behind the text content of the Spry Accordion?  I use Windows Vista.

    Hi,
    Yes, as is shown by the following code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body style="background: url(images/detail/cd1.jpg) no-repeat center;"> //use your own location and file
    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 1</div>
        <div class="AccordionPanelContent">Content 1</div>
      </div>
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 2</div>
        <div class="AccordionPanelContent">Content 2</div>
      </div>
    </div>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    //-->
    </script>
    </body>
    </html>

  • Semi-transparent foreground image on top of opaque background image

    The client has sent me this image (a low-res .jpg file) to place on top of a green gradient background (also provided, as a multi-layered .psd file). I'm to silhouette the image and place it on top of the green background at the appropriate size (easy) while maintaining the transparency of the grid and the reflection so that the green shows through (difficult ... as in I don't know how and haven't been able to Google up the answer). The end result will be used on the client's Website.
    I considered telling him it couldn't be done (not sure if that's true) or would be cost prohibitive (I would need to be able explain why it would take me longer to do than he thinks it should take). The third (and most desirable) alternative is that this is easier to do than I realize and I just need to be pointed to the proper instructions.
    Any advice?
    Thanks,
    Andrea

    Put the gradient in photoshop and also convert the jpg to .psd in same colour profile as gradient, then place graphic into gradient as a layer on top.  Set graphic to 'multiply'.  That is technically the way to do it.
    This will not look good, so you will want to isolate the blue bars of the graph and the arrow using 'select colour range' (and maybe some manual selection) then do 'command-j' to create another layer containing only those items and leave that as 'normal' (ie don't multiply that one) and it should look fine.
    There is no way to silhouette the fading part into the gradient, it must overlay.  Lifting the bars out is cheating a bit but will give nice appearance.
    Should only take a few mins, make sure your gradient has some noise in it   if you have any problems, I would be happy to do it for you if you want to send files to my email in profile....

  • Is it possible to draw a mesh on top of a background image in flash ?

    Problem i am trying to draw my 3d mesh on top of any image or an object in flash but my model is drawing under the image all the time i don't know how to sort this problem since i am bit new to flash development .
    Please help me with this thank you.

    Sorry about this messy code its because of this copy pasting stuff but if you could press ctrl + f and type Init mesh and Init Functions thats where everything is happening and this 3d mesh will be loaded
    using a preloader function in a separate file thats why i add a event with Added_to_stage to the listener Problem is once i Draw this mesh with their morph target on to the screen i couldn't able to draw anything
    in the background of this object everything comes on top of this 3d mesh .
    once again sorry for this mess anyway its still in the unit test phase  .
    package
    // All the import stuff hided by me ...
              [Event(name="FLACEventEncodingComplete", type="FLACEvent")]
              [Event(name="FLACEventDecodingComplete", type="FLACEvent")]
              [Event(name = "progress", type = "flash.events.ProgressEvent")]
              public class ChatBotMain extends Sprite
                        //Embedded assets
                     Variable which loads all the textures are hided ....
                        //engine variables
                        private var scene:Scene3D=new Scene3D();
                        private var camera:Camera3D = new Camera3D();
                        private var view:View3D = new View3D();
                        private var cameraController:HoverController;
                        private var dlight : DirectionalLight;
                        //material objects
                        Hided
                        //scene objects
                      Hided
                        //navigation variables
                     Hided
                    // morph targets
                        // hided ......
                        //Chatbot code
                     Hided
                        //Flac encoding variables
                     Hided
                        //button bitmaps
                      Hided
                        public function ChatBotMain():void
                                  var stage1:Stage = Stageobject;
                                  //trace("stage",stage1.stage);
                                  this.addEventListener(Event.ADDED_TO_STAGE,init);             
                         * Global initialise function
                        private function init(e:Event= null):void
                                  this.removeEventListener(Event.ADDED_TO_STAGE,init);
                                  microphone = Microphone.getMicrophone();
                                  microphoneBuffer.length = 0;
                                  microphone.rate = 16;
                                  flacCodec = (new cmodule.flac.CLibInit).init();
                                 initListeners();
                                 initEngine();
                                  initLights();
                                  initMaterials();
                                  initObjects();
                                  fileCount = 8;
                                  initChatBot();
                                  bootscreenBitmap.x = (width / 2) - (bootscreenBitmap.width / 2);
                                  bootscreenBitmap.y = (height / 2) - (bootscreenBitmap.height / 2);
                                 //addChild(bootscreenBitmap);
                                  headMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3.mesh.xml",onloaded,true);                   
                                  headMeshGeometry_blink = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_blink.mesh.xml", onloaded, true);
                                  headMeshGeometry_mouthopen = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_mouthopen.mesh.xml", onloaded, true);
                                  headMeshGeometry_smile = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/head3_smile.mesh.xml",onloaded,true);
                                  eyelMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/eyeball2_l.mesh.xml",onloaded,true);
                                  eyerMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/eyeball2_r.mesh.xml",onloaded,true);
                                 hairMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/hair3.mesh.xml", onloaded, true);
                                  shirtMeshGeometry = new CustomPrimative("C:/Users/Rakesh/Documents/flashport/Chatbot/embeds/shirt.mesh.xml",onloaded,true);
                                  //We can use the playerObject class to "analyse" the audio data as it is being played
                                  //Currently not needed due to just moving the mouth in random patterns as the speech plays
                                  playerObject.outputSnd = new Sound();
                                  playerObject.outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
                        private static const FLOAT_MAX_VALUE:Number = 1.0;
                        private static const SHORT_MAX_VALUE:int = 0x7fff;
                        * Converts an (raw) audio stream from 32-bit (signed, floating point)
                        * to 16-bit (signed integer).
                        * @param source The audio stream to convert.
                         public function convert32to16(source:ByteArray):ByteArray
                              * Called when encoding has finished.
                        private function encodingCompleteHandler(event:*):void {
                        function ioErrorHandler(e:Event):void {
                                  trace("error");
                                  thinking = false;
                                  microphoneButton.upState = upButton;
                                  microphoneButton.overState = downButton;
                                  microphoneButton.downState = downButton;
                        function loaderCompleteHandler(e:Event):void {
                                  var loader:URLLoader = URLLoader(e.target);
                                  var str:String = loader.data;
                                  trace(str);
                                 if (str.length > 0)
                                          _mytext.text = str;
                                           sendText();
                                  thinking = false;
                                  microphoneButton.upState = upButton;
                                  microphoneButton.overState = downButton;
                                  microphoneButton.downState = downButton;
                                  //var responseVars = URLVariables( e.target.data );
                                  //trace( "responseVars: " + responseVars );
                         * Called when the encoding task notifies progress.
                        private function encodingProgressHandler(progress:int):void {
                                  trace("FLACCodec.encodingProgressHandler(event):", progress);
                                  dispatchEvent( new ProgressEvent(ProgressEvent.PROGRESS, false, false, progress, 100));
                        private function getElapsedTime():int {
                                  var now:int = getTimer();
                                  return now - initTime;
                        private function start() : void {
                                  initTime = getTimer();
                        public function encode(data:ByteArray):void
                        private function onSampleData(event:SampleDataEvent):void
                        private function onloaded(event:CustomPrimativeEvent):void
                                  fileCount--;
                                  trace("loaded geometry " + event.asset.url);
              function processSound(event:SampleDataEvent):void
               private function drawButton():void
                        private function buttonPressed(e:Event):void {
                                  if (!thinking)
                                    if (recording)
                                             StopRecording();                                                                                   
                                    else
                                              //start recording
                                              recording = true;
                                                 hided
                        private function StopRecording(): void
                                  //stop recording
                                  recording = false;
                                  microphone.removeEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);
                                  encode(microphoneBuffer);
                        private function initChatBot()
                        function keyHandler(e:KeyboardEvent)
                                  if(e.charCode == 13)
                                            sendText()
                    private function onOpen(e:Event)
                             debugOutput2.text = "Connection opened";
             private  function onStatusChange(e:HTTPStatusEvent)
                    debugOutput2.text = "Status Changed to "+e.status;
            private  function onMessageFailIO(e:Event)
                debugOutput2.text = "IO ERROR: Could not send your request. Please try again later.";
                         private  function onMessageFailSecurity(e:Event){
                debugOutput2.text = "Security ERROR: Could not send your request. Please try again later.";
             private     function sendText()
                                  if(_mytext.text != "")
                                            chatHistoryText.text = chatHistory("You : " + _mytext.text);
                                            var variables:URLVariables = new URLVariables(); 
                                            var request:URLRequest = new URLRequest(urlToSend); 
                                            variables.sessionid = _sessionid
                                            variables.chattext = _mytext.text; 
                                            chatLoader.dataFormat = URLLoaderDataFormat.VARIABLES; 
                                            request.data = variables; 
                                            request.method = URLRequestMethod.POST; 
                    chatLoader.addEventListener(Event.COMPLETE, getAudio); 
                    chatLoader.addEventListener(Event.OPEN,onOpen);
                    chatLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS,onStatusChange);
                    chatLoader.addEventListener(IOErrorEvent.IO_ERROR,onMessageFailIO);
                    chatLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onMessageFailSecurity);
                                            chatLoader.load(request);
                                            _mytext.text = "";
                        function chatHistory(newText):String
                                  chatTextArr[0] = chatTextArr[1];
                                  chatTextArr[1] = chatTextArr[2];
                                  chatTextArr[2] = chatTextArr[3];
                                  chatTextArr[3] = chatTextArr[4];
                                  chatTextArr[4] = chatTextArr[5];
                                  chatTextArr[5] = newText;
                                  var chatHistory = chatTextArr[0] != ""?chatTextArr[0]+"\n":"";
                                  chatHistory += chatTextArr[1] != ""?chatTextArr[1]+"\n":"";
                                  chatHistory += chatTextArr[2] != ""?chatTextArr[2]+"\n":"";
                                  chatHistory += chatTextArr[3] != ""?chatTextArr[3]+"\n":"";
                                  chatHistory += chatTextArr[4] != ""?chatTextArr[4]+"\n":"";
                                  chatHistory += chatTextArr[5] != ""?chatTextArr[5]+"\n":"";
                                  return chatHistory;
                        function randomNumber()
                                  var rand = Math.random() * 1000000;
                                  return Math.round(rand);
                        function getAudio(e:Event)
                                  var loader:URLLoader = URLLoader(e.target);
                                  //traceTxt.text = loader.data.soundFile;
                                  debugOutput.text = loader.data;
                                  var getStr:String = loader.data.soundFile;
                                  var arr:Array = getStr.split("^_^");
                                  loadAudio(arr[0], arr[1]);
                        function loadAudio(audioFile, textChat)
                        function completeHandler(event:Event):void
                                  trace("completeHandler")
                      * Initialise the engine
                        private function initEngine():void
                                  trace("intEngine");
                                  //view.graphics.clear();
                                  view.antiAlias = 4;
                                  view.backgroundColor = backgroundColour;
                                  view.scene = scene;
                                  view.camera = camera;
                                  //setup controller to be used on the camera
                                  cameraController = new HoverController(camera, null, 25, 10, 70);
                                  cameraController.panAngle = 90;
                                  cameraController.tiltAngle = 2.5;
                                  lastPanAngle = cameraController.panAngle;
                                  lastTiltAngle = cameraController.tiltAngle;
                                 view.addSourceURL("srcview/index.html");
                                  addChild(view);
                                  //Uncomment this to show some stats
                                  var stats:AwayStats = new AwayStats(view);
                                  stats.y = 100;
                                  //addChild(stats);
                        * Initialise the lights in a scene
                        private function initLights():void
                                  //Add a point light
                                  // hided
                                 scene.addChild(light);
                         * Initialise the materials
                        private function initMaterials():void
                         * Initialise the scene objects
                        private function initObjects():void
                                 //default available parsers to all
                                  Parsers.enableAllBundled();
                                  AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
                                  var grid:WireframeGrid = new WireframeGrid(14, 140);
                                  //view.scene.addChild(grid);
                        private function InitMesh()
                                  var headMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new headTexture().bitmapData));
                                  var eyeMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new eyeTexture().bitmapData));
                                  var shirtMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new shirtTexture().bitmapData));
                                  var hairalphaMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new hairalphaTexture().bitmapData))
                                  //Not using specular maps at this stage
                                  //headMaterial.specularMap = new BitmapTexture(new headSpecularTexture().bitmapData);
                                  headMaterial.repeat = true;
                                  headMaterial.bothSides = true;
                                 headMaterial.alphaThreshold = 0.5;
                                 headMaterial.gloss = 100;
                                 headMaterial.specular = 3;
                                  headMaterial.ambientColor = 0x808080;
                                  headMaterial.ambient = 1;
                                //create subscattering diffuse method
                                  subsurfaceMethod = new SubsurfaceScatteringDiffuseMethod(2048, 2);
                                  subsurfaceMethod.scatterColor = 0xff7733;
                                  subsurfaceMethod.scattering = .05;
                                  subsurfaceMethod.translucency = 4;
                                  eyeMaterial.repeat = true;
                                 eyeMaterial.bothSides = true;
                                  eyeMaterial.lightPicker = lightPicker;
                                  hairalphaMaterial.lightPicker = lightPicker;
                                  hairalphaMaterial.gloss = 100;
                                  hairalphaMaterial.specular = 3;
                                  hairalphaMaterial.ambientColor = 0x808080;
                                  hairalphaMaterial.ambient = 1;
                                  newmesh = new Mesh(headMeshGeometry, headMaterial);
                                  hairmesh = new Mesh(hairMeshGeometry, headMaterial);
                                  eyelmesh = new Mesh(eyelMeshGeometry, eyeMaterial);
                                 eyermesh = new Mesh(eyerMeshGeometry, eyeMaterial);
                                  shirtmesh = new Mesh(shirtMeshGeometry, shirtMaterial);
                                  //newmesh.castsShadows = true;
                                 newmesh.subMeshes[0].material = headMaterial;
                                  hairmesh.subMeshes[0].material = hairalphaMaterial;
                                  eyelmesh.subMeshes[0].material = eyeMaterial;
                                  eyermesh.subMeshes[0].material = eyeMaterial;
                                  view.scene.addChild(newmesh);
                                  view.scene.addChild(hairmesh);
                                  view.scene.addChild(eyelmesh);
                                  view.scene.addChild(eyermesh);
                                  view.scene.addChild(shirtmesh);
                                  eyelmesh.rotationY = 90;
                                  eyermesh.rotationY = 90;
                                  newmesh.rotationY = 90;
                                  hairmesh.rotationY = 90;
                                  eyelmesh.rotationZ = 90;
                                  eyermesh.rotationZ = 90;
                                  newmesh.rotationZ = 90;
                                  hairmesh.rotationZ = 90;
                                  //hairmesh.y += 1.8;
                                  hairmesh.y = 7.9;
                                  hairmesh.x = -6.0;
                                  eyermesh.y += 8;
                                  eyermesh.z += 4.6;
                                  eyermesh.x += 10.1;
                                  eyelmesh.y += 8;
                                  eyelmesh.z -= 4.6;
                                  eyelmesh.x += 10.1;
                                  shirtmesh.rotationX = -90;
                                  shirtmesh.y = -12.0;
                                  shirtmesh.x = -3.0;
                                  var meshOffset:int = 4;
                                  newmesh.y += meshOffset;
                                  hairmesh.y += meshOffset;
                                  eyermesh.y += meshOffset;
                                  eyelmesh.y += meshOffset;
                                  morpher = new Morpher(newmesh);
                                  morphTarget_mouthopen = new MorphTarget(headMeshGeometry_mouthopen, headMeshGeometry);
                                  morphTarget_smile = new MorphTarget(headMeshGeometry_smile, headMeshGeometry);
                                  morphTarget_blink = new MorphTarget(headMeshGeometry_blink, headMeshGeometry);
                                 var backplane:PlaneGeometry = new PlaneGeometry(512, 256);
                                 var carehomeMaterial:TextureMaterial = new TextureMaterial(new BitmapTexture(new carehomeClass().bitmapData));
                                 var backplaneMesh:Mesh = new Mesh(backplane, carehomeMaterial);
                                  backplaneMesh.rotationX = -90;
                                  backplaneMesh.rotationY = -90;
                                  /*view.scene.addChild(backplaneMesh);
                                  backplaneMesh.x = -90;*/
                                  var sphereGeometry:SphereGeometry = new SphereGeometry(4);
                                  var sphereMaterial:ColorMaterial = new ColorMaterial( 0xffffff );
                                  lightmesh = new Mesh(sphereGeometry, sphereMaterial);
                                  view.scene.addChild(lightmesh);
                         * Initialise the listeners
                        private function initListeners():void
                                  addEventListener(Event.ENTER_FRAME, onEnterFrame);
                                  //stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
                                  //stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
                                  stage.addEventListener(Event.RESIZE, onResize);
                                  onResize();
                         * Navigation and render loop
                        private function onEnterFrame(event:Event):void
                                  this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
                                  if (recording)
                                            if ((getTimer() - recordingTime) > 4 * 1000)
                                                     StopRecording();
                                  if (newmesh == null)
                                            if (headMeshGeometry != null && hairMeshGeometry != null && eyelMeshGeometry != null && eyelMeshGeometry != null )
                                                      if (fileCount == 0)
                                                                InitMesh();
                                  cameraController.panAngle = 90;
                                  cameraController.tiltAngle = 2.5;
                                  if (newmesh != null)
                                            if (bootscreenBitmap.alpha > 0)
                                                      bootscreenBitmap.alpha -= 0.015;
                                            else
                                                      bootscreenBitmap.alpha = 0;
                                            logo.alpha = 1 - bootscreenBitmap.alpha;
                                            sagalogo.alpha = 1 - bootscreenBitmap.alpha;
                                            chatHistoryText.alpha = 1 - bootscreenBitmap.alpha;
                                            _mytext.alpha = 1 - bootscreenBitmap.alpha;
                                            microphoneButton.alpha = 1 - bootscreenBitmap.alpha;
                                            if (lastblink == 0)
                                                      if (blinkdirection)
                                                                blinkAmount += 0.25;
                                                                if (blinkAmount > 1)
                                                                          blinkAmount = 1;
                                                                          blinkdirection = !blinkdirection;
                                                      else
                                                                blinkAmount -= 0.25;
                                                                if (blinkAmount < 0)
                                                                          blinkAmount = 0;
                                                                          blinkdirection = !blinkdirection;
                                                                          lastblink = 100;
                                            else
                                                      lastblink--;
                                            if (animdirection)
                                                      animAmount += 0.20;
                                                      if (animAmount > maxAnimAmount)
                                                                animAmount = maxAnimAmount;
                                                                animdirection = !animdirection;
                                           else
                                                      animAmount -= 0.20;
                                                      if (animAmount < 0)
                                                                animAmount = 0;
                                                                animdirection = !animdirection;
                                                                var r:int = (Math.random() * 6);
                                                                currentMorph = morphTarget_mouthopen;
                                            if (speechPlaying)
                                                      currentScale = animAmount;
                                            else
                                                      currentScale = 0;
                                            //Apply the morph targets, first apply the base, then apply the blink and the mouth shape
                                            morpher.ApplyBaseToMesh(newmesh);
                                            if (lastblink == 0)
                                                      morpher.ApplyMorphTarget(newmesh, morphTarget_blink, blinkAmount);
                                                      if (currentMorph != null)
                                                                morpher.ApplyMorphTarget(newmesh, currentMorph,currentScale);
                                  light.x = Math.sin(-180/*getTimer()/1000*/)*30;
                                  light.y = 15;
                                  light.z = Math.cos(-180/*getTimer()/1000*/)*30;
                                  if (lightmesh != null)
                                            lightmesh.position = light.position;
                                  view.render();
                         * Listener function for asset complete event on loader
                        private function onAssetComplete(event:AssetEvent):void
                                  if (event.asset.assetType == AssetType.MESH)
                         * Mouse down listener for navigation
                       private function onMouseDown(event:MouseEvent):void
                                  lastPanAngle = cameraController.panAngle;
                                  lastTiltAngle = cameraController.tiltAngle;
                                  lastMouseX = stage.mouseX;
                                  lastMouseY = stage.mouseY;
                                  move = true;
                                  stage.addEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
                         * Mouse up listener for navigation
                        private function onMouseUp(event:MouseEvent):void
                                  move = false;
                                  stage.removeEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
                         * Mouse stage leave listener for navigation
                        private function onStageMouseLeave(event:Event):void
                                  move = false;
                                 stage.removeEventListener(Event.MOUSE_LEAVE, onStageMouseLeave);
                         * stage listener for resize events
                        private function onResize(event:Event = null):void
                                 view.width = stage.stageWidth;
                                  view.height = stage.stageHeight;

  • My background images do not bleed in the Family Album theme if I put photos on top of the background image. Does anyone know how to fix this?

    My background photos in the Family Album theme do not bleed when I put another photo on top of them. Does anyone know how to fix this in iphoto 9?

    Can you post a screenshot of what you're seeing on that page? In the meantime try this basic fix: make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    Happy Holidays

  • Adding .flv or .swf in dreamweaver on top of background image

    Hi,
    I added an image  background 1900 x 1200 in dreamweaver, which will serve as my  background image for my web site. I would like to incorporate my .flv or  .swf on top of my background image. Although, when doing so, the .flv  or .swf gets placed under the background image and not on top. How do I  place the .flv or .swf file on top of my background image in Dreamweaver  CS5.
    Thanks

    Hi
    This sounds as though you are not actually using a  background-image but just placing an image on the page. To get any help  people will have to see your page and the code, can you provide a link  to a live page?
    BTW: Your background-image size is way to big for most users monitors, just thought you should know.
    PZ

  • TextField on top of background image

    How can I put a textField on top of a background image with JSC?

    How can I put a textField on top of a background image with JSC?I believe that when you put a background image in JSC... everything else would go on top of the background image. You set the background image by selecting the Background Image property under the Appearance part of the Properties panel. There you can select the image you want to set as background.
    On the other hand, if you insert a separate image component instead of the background image... there you may have to tell your textField to go on top of the image. You do this by right-clicking the textField and selecting the Bring To Front option.
    Franklin Angulo

  • Can I control the position of the page background image?

    Hi All!
    My simple question: Can I control the position of the background image for example in a user-made style? I mean can I make the position of the image to center rather then tile? If it possible without editing the html code...

    To create a background image for a region create a table nested within that region using the following definition <TABLE WIDTH="100%" HEIGHT="100%" CELLPADDING="0" CELLSPACING="0" MARGIN="0" BORDER="0"> and create an image call integrated into the <TD> tag within said table.

  • Controlling Background Images!!!!!!!!!

    Is it possible to control how a page's background image
    tiles? For example, I have a band )approx. 300px tall) that I would
    like to continuously tile horizontally, not verticaly. Can this be
    done?

    You can with the use of css:
    .foo {background: url(headerbg.jpg) repeat-x;}
    and then apply that class (foo is only an example :) to the
    container or
    to the body tag if you want it as the background to the
    actual page.
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au
    "macromike" <[email protected]> wrote in
    message
    news:f58n5o$kms$[email protected]..
    > Is it possible to control how a page's background image
    tiles? For
    > example, I have a band )approx. 300px tall) that I would
    like to
    > continuously tile horizontally, not verticaly. Can this
    be done?

  • Can Edge Reflow handle type on top of background image within a box?

    What I mean is, from code point of view, it's not <img src="">, but <style="background: url()">, then put type on top of the background image.  Can Edge Reflow handle that?  Really appreciate your help.

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/edge_reflow_preview

  • Background Images on Frame

    I'need put a Image as a background of my Frame (.java) and not see on awt, swing and otrher user controls this option. How i'do to make this?

    Hi,
    try
    public class VendingPanel extends JPanel {
    private ImageIcon   backgroundImage = new ImageIcon(this.getClass().getResource("coffeebckg.jpg"));
         * Implements the code needed to show the background image. Note that all
         * panels that are placed on top of the background image <b>must</b> have opaque
         * set to false
         * @param g
        public void paint( Graphics g )
            // First draw the background image - tiled
            Dimension d = this.getSize();
            for( int x = 0; x < d.width; x += backgroundImage.getIconWidth() )
                for( int y = 0; y < d.height; y += backgroundImage.getIconHeight() )
                g.drawImage( backgroundImage.getImage(), x, y, null, null );
                // Now let the regular paint code do it's work
                super.paint(g);
    }Frank

  • Having trouble making background image editable in template

    Hello this is my first time so here goes...
    I would like to make a template from a page I have created,
    the trouble is the background image is url background image placed
    in css with text over the image, the problem I have is on further
    pages I would like to keep same divs
    but would like the freedom to change text and bground image.
    I have tried to make text an editable region which works and
    bground image make attribute editable but I do not really
    understand how this works any ideas would be much appreciated here
    is my site address
    http://www.andysite.prohost4u.co.uk
    cheers

    I'm confused, I dont see that you have a background image in
    your css.
    "WILLO THE WISP" <[email protected]> wrote
    in message
    news:[email protected]...
    >
    Hello this is my first time so here goes...
    > I would like to make a template from a page I have
    created, the trouble is
    > the
    > background image is url background image placed in css
    with text over the
    > image, the problem I have is on further pages I would
    like to keep same
    > divs
    > but would like the freedom to change text and bground
    image. I have tried
    > to
    > make text an editable region which works and bground
    image make attribute
    > editable but I do not really understand how this works
    any ideas would be
    > much
    > appreciated here is my site address
    http://www.andysite.prohost4u.co.uk
    > cheers
    >
    >
    > Here is my css
    > * {
    > margin : 0 auto;
    > padding : 0;
    > }
    > body {
    > background-color : #ffffff;
    > text-align : center;
    > font-family : "Square721 BT", "Staccato222 BT", Courier;
    > font-size : 100%;
    > background-position : center center;
    > }
    > #container {
    > font-family : "Square721 BT", "Staccato222 BT", Courier;
    > background-color : #ffffff;
    > width : 780px;
    > }
    > #header {
    > width : 780px;
    > height : 280px;
    > margin-top : 10px;
    > margin-bottom : 10px;
    > }
    > #content {
    > background-image: url(images/content_bground.gif);
    > float: left;
    > height: 400px;
    > width: 430px;
    > }
    > #content h1 {
    > font-size : 115%;
    > width : 390px;
    > color : #00ccff;
    > text-align : left;
    > padding-left : 60px;
    > padding-top : 40px;
    > padding-bottom : 10px;
    > }
    > #content p {
    > font-size : 80%;
    > width : 310px;
    > text-align : justify;
    > text-indent : 20px;
    > color : #66FFFF;
    > }
    > #content h2 {
    > font-size : 80%;
    > width : 420px;
    > color : #00ccff;
    > text-align : left;
    > padding-left : 60px;
    > height : 70px;
    > padding-top : 10px;
    > }
    > #sidebar {
    > background-image : url(images/sidebar_bground.gif);
    > width : 340px;
    > height : 400px;
    > float : right;
    > }
    > #sidebar ul {
    > font-size : 60%;
    > line-height : 22px;
    > list-style-image : url(images/bullet.gif);
    > list-style-position : outside;
    > text-align : left;
    > color : #66FFFF;
    > padding-top : 45px;
    > padding-left : 62px;
    > }
    >
    > #clear {
    > clear : both;
    > }
    > #footer {
    > background-image : url(images/footer_bground.gif);
    > width : 780px;
    > height : 80px;
    > margin-bottom : 10px;
    > margin-top : 10px;
    > position: fixed;
    > }
    > #footer p {
    > text-align : center;
    > font-size : 75%;
    > color : #66ffff;
    > padding-top : 24px;
    > }
    > #footer ul {
    > margin : 2px;
    > }
    > #footer li {
    > display : inline;
    > margin : 0;
    > }
    > #footer a:link, #footer a:visited {
    > color : #00ccff;
    > margin : 2px;
    > }
    > #footer a:hover, #footer a:active {
    > color : #00FFFF;
    > text-decoration : none;
    > background-color : #33cccc;
    > }
    > a:link {
    > color : #00ccff;
    > text-decoration : none;
    > }
    >
    > a:visited {
    > text-decoration : none;
    > color: #00CCFF;
    > }
    > a:hover {
    > text-decoration : underline;
    > color: #00FFFF;
    > }
    > a:active {
    > text-decoration : none;
    > color: #006699;
    > }
    >

  • Background Image Not Visible in Browser

    I have searched the forum but I'm not finding a solution that
    works.
    I'm trying to put a background .png image in a header. It
    shows up in Dreamweaver but not in preview mode. I have an external
    style sheet that contains this:
    .twoColFixRtHdr #header {
    background-repeat: no-repeat;
    height: 126px;
    width: 770px;
    padding: 0;
    background-position: left top;
    margin: 0px;
    background-image: url(assets/pictures/banner_3.png);
    My page contains the following:
    <div id="header">
    <h1 class="banner_title_top">Text</h1>
    <h1><span class="banner_title_bottom">Text
    </span>
    <!-- end #header -->
    </h1>
    The ".twoColFixRtHdr" is coming from the fact that I'm using
    a pre-made Dw CSS layout.
    Any help is very appreciated.
    Jason

    Should have made no difference.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "j-hill" <[email protected]> wrote in
    message
    news:fb4cnk$fku$[email protected]..
    > Out of desperation I tried to convert my image to a .jpg
    and it seems to
    > be working fine.
    >
    > Thanks,
    > Jason

Maybe you are looking for