Soften the edge of a photo

I have video footage for which I have laid a photo over the top with 60% opacity, the photo has hard edges, how can i soften them

This will do it, also.
http://www.fcproxuniversity.com/downloads/templates/Picture_In_Picture.zip

Similar Messages

  • Soften the edge of a wipe???

    As a recent FCP to Premiere switcher I'm still finding where things are etc in premiere but the one thing I cannot seem to find is the ability to soften the edge of a wipe transition. Am I missing something???   Thanks!

    Brilliant ! and I was looking in "Video Transitions" and not "Video Effects" the whole time! Thank you sir!

  • How can I soften the edge of a person in a photograph without changing the background?

    I need to soften the outline of a girl in a photo without changing the background.  I have tried the Modify Edges tool in the selections menu, but the results of the feathering command do not show up on the photo.  Help!

    Or you could brush with the Blur Tool.
    -Noel

  • I need help erasing the background of a photo.

    Sometimes I do it just fine and other times I can't get it to magic erase the background to save my neck.
    I've spent 4 hours trying to get this done today......earlier I did it to a photo in 5 minutes.
    HELP

    There's another approach to getting a transparent background -- using the selection brushes, but for a subject with areas of wispy hair you'll definitely need to do some handwork.
    Use the Quick Selection brush on the woman, alternating between the "add" and "subtract" modes to get a close approximation.
    Switch to the Selection Brush tool to refine the selection.
    Use Select...Feather with a setting of 1.7 pixels to soften the edges.
    Layer...New...Layer via Copy to copy the woman to a new layer with transparency.
    Now the most tedious part -- refining the wisps of hair.  Fortunately, there's only a small area that needs the work:
    Zoom in real tight and remove most of the dark areas by clicking on them with the Magic Eraser tool set to Tolerance:  32, Anti-Alias, and Contiguous. 
    Use the Background Eraser with a Tolerance of 14% to further remove dark areas internally and at the outer edges. 
    Use the Eyedropper to select a light gray hair colour and the Color Replacement Tool to paint over the wisps of hair to remove most of the green colour cast.
    Use the Clone tool at a 4pixel size to draw over some areas of the wisps of hair to further remove the green cast.
    Use the Smudge tool at about a 7px size to smooth out the tone in the individual wisps.
    Now comes the fun part of building the final image:
    Add two Color Fill layers beneath the extracted image.
    Change the colour of the upper Color Fill layer to a dark, somewhat gray blue.
    Change the colour of the lower Color Fill layer to a light, somewhat gray green.
    Draw a black-to-white radial gradient on the mask of the upper blue Color Fill layer, starting at the lower left and running to the upper right.
    Add a new empty layer immediately below the extracted image.
    On that empty layer, use Filter...Render...Clouds.
    On that clouds layer, use Filter...Blur...Surface Blur with a Radius:  25px and a Threshold:  25px.
    Set the Blend Mode of that clouds layer to "Multiply" and the Opacity to 62%.
    Refine and balance the overall effect by using the Eraser tool with a hard edge on the extracted image layer to clean up some of the edges, and use the Blur tool to get rid of any obvious hard edges.
    The layers wind up looking like this:
    And the final image looks like this:
    That clouds layer gives a nice, blurred "semi-natural" looking outdoors effect to the background -- since the lighting on her face is obviously natural sunlight, the background should also seem to be an outdoors background.
    Ken

  • Feathering a layer's edge - increasing intensity closer to the edge

    I am working on a project where I need to make an office chair appear to have eyes. Specifically, dog eyes.
    I'm having trouble getting the edges of my eyes to look like they are part of the chair, which got me wondering. Is there a way to feather my edges with increased intensity closer to the edge? To be specific, I'd like to start the feather 100px inside the border with 60% opacity, all the way to the edge (border) with 0% opacity. I tried doing this manually a couple of ways and it just didn't look uniform. I'll post the photos I am using below, in case that might help. Please let me know if any additional information might help as well.
    I have also tried with the eyes seperated (without the middle area), but I still have the same issues.
    I found this image that shows what I'm trying to do.

    Two eye layers - and a small piece of copied chair on a layer above the bottom one. The small blue bit is set to Hue, so it colors the bottom eye layer. Mask out all but the eyes on the top layer, and leave just enough of the bottom (blue) eye layer to give some definition.

  • How to make one edge of a photo transparent

    Hi,
    I am doing a website and want to make one edge of a photo transparent to the background - such as http://www.aimeemann.com/
    Does anyone know how I would do this?
    Thanks much!
    Nic

    Double click the layer icon in the layers panel. Then hit the create mask button at the bottom of the panel (lower red circle). Then with the layer mask selected (upper red circle, notice the black outline shwoing you are working the mask, not the layer), use the gradient tool to make a gradient as shown in the icon preview. Then save for web as PNG24.
    <br />
    <br />
    <a href="http://www.pixentral.com/show.php?picture=1pTgqlM1shye4AuiOINeT6f1833CF0" /></a>
    <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1pTgqlM1shye4AuiOINeT6f1833CF0_thumb.gif" border="0" />

  • How do I page set to print to the edge of A4?

    Hi there,
    This is probably a simple and ridiculous question for those of you who work in publishing - I'm an artist using ID for the first time!
    I just want to design a page with colour and lines that go right to the edge of A4 paper. How do I set a page up properly to do this? I'm thinking about when I go to have the pages commercially printed. If I want a whole A4 designed page, do they end up having to print it on bigger paper and then cut it down, or can you set the ID file up so that they can print directly onto A4 - no chopping required!
    Many thanks for any help! :-)
    Hamish

    Hoglet22 wrote:
     …do they end up having to print it on bigger paper and then cut it down…
    That's generally how it's done in commercial printing. Set up your document size to the size of your finished page and let part of your image hang off the edge of the page (called the "bleed"). When printed on larger paper with trim marks, the extra image will be removed, and it will look like it was printed to the edge of the paper, when in fact, it was just trimmed to look that way.
    Hoglet22 wrote:
     …or can you set the ID file up so that they can print directly onto A4 - no chopping required! 
    There are photo printers that can print borderless, but unless you know what printer you will be using, it's a risk to assume this is possible. Best bet is to talk to who ever is printing this, and ask what they require.

  • Auto crop Scanned Images w/black edge? 1500+ photos to crop!

    I have a job where the client scanned over 1500 photos but didn't crop them properly so there's random black bars & edges everywhere that I'm required to get rid of. Is there any way for Photoshop or ANY application to auto detect and crop & save a batch of photos? This would save me a TON of work. Any suggestions would be greatly appreciated.
    I'm currently running Mac OS X Leopard10.5.5, CS3 production suite, Aperature, iPhoto and more

    >Wouldn't that make cropping unpredictable?
    Only if the complete edge of a pic has the same values (and then really isn't it part of the edge? ;) ). Crop works on the bounds, so pixels inside don't matter. I think to really answer the post, we need a better idea of what these edges are. 0,0,0 generated by cropping as a bg color? Scanned rich black complete with detectable kicker rosette? Tranny black?
    J

  • I am very unsatisfied with my C309 printer cutting the edges off my photos

    I fully understand if I chose borderless that for some reason if cuts off about 2.5 - 3mm. when I try to prin 4x6.  Is there any way around this?  I have made adjustments and tried to change the overspray from default to least and this did nothing.  I don't think that I should have to factor into account that I am going to lose data if I have my image saved exactly 4x6 from a photo software and want what I see on the screen to print exact same way.  I had a previous HP printer and this was never an issue until I got this particular model. 

    How recently did you switch?  If it's less than 60 days, then Verizon simply reinstates your previous account.  The fact that you were on the EDGE plan and mailed the devices back, and they apparently are somewhere in the system, could cause complications, and it might just work out that you just go back on the same plan and they set you up with the same devices.  I'm not sure how it will go - but since you are still being billed for the devices... 

  • Any way to soften the edges on a background in a "Basic Slate" title?

    I'm using Spherico Basic Slate to create my Lower Thirds. The film is in another language so I have to subtitle too- so it's getting to be a lot of text on the screen. I am using a black background with white letters (opacity at 50%) I hate the edges on the background though, and I'm trying to soften them. I tried Soft Edges but that didn't work- it spread the edge all the way across the frame. I just want to soften up the end of the background a bit so it's easier on the eye. Thanks for any advice.

    The film is in another language so I have to subtitle too- so it's getting to be a lot of text on the screen. I am using a black background with white letters (opacity at 50%) I hate the edges on the background though, and I'm trying to soften them. I tried Soft Edges but that didn't work- it spread the edge all the way across the frame. I just want to soften up the end of the background a bit so it's easier on the eye.< </div>
    There are many subtitle plugs for FCP; we use Digital Heaven's subtitler.
    Your desire for expedited workflows "stuff like this" is not commercially viable or someone might have created a plugin especially for the purpose. Maybe they have. Where have you looked? Hundreds of plugs for FCP are on the market or you can write one of your own. The development tools for FXPlug and FXScript are easily researched and located and downloaded if you are inclined to write code or use nodes.
    However, creating lower thirds is a standard video editing chore. You can create lots of presets for various sizes, transparencies, and colors of backgrounds (anecdotal drivel: we used to call them "pills" because of their shape) save them and just pull them from a bin.
    bogiesan

  • Did you know the tablets are now available with the Edge program?

    While tablets are now able to be purchased with the Edge, the Device Payment Plan has been discontinued. So, if you want to pay over 12 months, to keep unlimited data, you are out of luck. Either full price, or lose it and use Edge.
    Just another way for Verizon to get rid of unlimited.

    I would check again. The problem is when you went to a corporate store and that is the only way to get it. The stores were telling customers that Verizon's device payment plan was only for tablets.
    That is the first lie on their parts. The second thing the store would tell customers that if you used the plan you would still lose unlimited data, lie two.
    You could not grandfather in a plan such as the device payment plan. Grandfathered to whom? Those who already choose it and are on it?  Those who got grandfathered in how? Maybe a wrong choice of word in your post.
    Like Ann154 the plan is still showing on the Verizon wireless site.
    I also called my former account executive at Verizon and he said he knew of no discontinuance of the program.
    So unless you have advance information via working for Verizon wireless I would wait for the news release.
    In your case I would go to a corporate store and insist on them honoring the Device Payment Plan. Maybe mention your attorney, or a state regulatory agency etc.
    Good Luck

  • Every time I open Iphoto I get the following message:  "A photo has been found in the iPhoto library that was not imported.  Do you want to import it?  Yes or No"  Any suggestions?

    Every time I open Iphoto I get the following message:  "A photo has been found in the Iphoto library that was not imported.  Does anyone have any suggestions?

    Quit iPhoto and to to the iPhoto library (by default in your pictures folder) - right click (control click) on it and select show package contents - find the folder named import (on importing) and drag it to the desktop - DO NOT MAKE ANY OTHER CHANGES - launch iPhoto and you will be fine.
    Open the import(ing) folder and if there is nothing in it that you need move it to the trash and empty the trash
    LN

  • Anyone know how to get out of the edge program?

    I dropped my old phone in the toilet and it was not time for an upgrade. Therefore, I went to the get a phone under the Edge Program. I specifically asked the rep at the store if I could go back to two year contract after I paid off the 50% of the program and he said yes. I hate this program. I only did it because I needed a phone and was not due an upgrade.  Now I understand that the only way I can get out of the Edge Program is to pay off the entire balance of the phone...which is outrageous. I no longer want to pay monthly installments. I want to pay a one time 2-year upgrade fee and start a new contract. It is my understanding my only choice is to pay off the entire edge or return the phone to Edge up. Problem is my phone has a small crack that I didn't realize was there until my son told me about it.  If you look at the phone normal you don't see it but if you look at it from an angle you can see the crack.
    I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack.  Otherwise, I would need to pay the insurance to get a new phone and then turn it in. This still cost me money. I am contemplating just paying off the rest of the balance and then maybe it will say I can get a new two-year contract, like it does for the other phones on my account.
    I have been a verizon customer way back when it was called Bell Atlantic Mobile and you would think they could do something for me since I have been a good customer all these years.  I don't want to leave because I have four other phones and a tablet with Verizon but I will if I have too. I would obviously go to AT&T. 
    Does anyone, maybe a verizon rep, have any options for me?

    rellis64 wrote:
    ... I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack. 
    Does anyone, maybe a verizon rep, have any options for me?
    I'm not a Verizon rep, just another customer like you. EDGE is a payment plan, or Rent to Own, or a lease program if you intend to keep upgrading.  If you want off the EDGE program, you can pay off the total balance due on the phone and keep it, and then you can start a new two year contract with a different phone. 
    In order to return the phone at the 50% point, and be done with EDGE, the phone has to be in good working condition.  The crack means it's not in good condition, so you will be charged the full price, whether you plan to EDGE up or go contract.  Either way, you'll end up paying for the EDGE phone, over time or in a lump sum.  It was one way to get a new phone when you were not eligible for the discounted price on your previous phone, but you need to fulfill that obligation before you can get another discounted phone.
    Do you want a new phone/different phone?  Look at eBay or swappa, or check with your friends who may have something you can borrow.  Or simply keep using the EDGE phone until it's paid for, then look at options at that time.

  • Have been a Verizon customer since I got my first cell phone in my 30's - I am 50 now! A year ago, I stupidly opted to get a new phone on the EDGE program because I was trying my first Samsung device and was not sure I would like it having been an IPhone

    have been a Verizon customer since I got my first cell phone in my 30's - I am 50 now! A year ago, I stupidly opted to get a new phone on the EDGE program because I was trying my first Samsung device and was not sure I would like it having been an IPhone user for years.I was right! Or so I thought.... The Note 3 has been horrible. I am on my second phone(replaced it under warranty) and it still freezes, shuts off on its own, and will not come back on for long periods of time. Having had enough, I decided to EDGE Up to another device. On March 16th I tried to edge up my device online but was unable to. I immediately called to figure out what the problem was. Back in October I had a mix up in my billing where I had set up a payment. It was not done properly by customer service and as a result my line was cut off. I called the EXACT day it went off, filed a complaint about the lack of follow through for my arranged payment, and thought I had it straightened out as the payment was made that same day. That incident, although it was a Verizon error, caused my Edge Contract to be "hotlined". I spent an hour on the phone on March 16th clearing the whole mess up. When the conversation ended, the Verizon representative admitted it was a Verizon error, documented everything, and then told me she was filing a release for the hotline hold that would take a couple of days. Her name was Linda and I stupidly trusted what she said.
    The days passed as I prepared to have a major foot surgery and to get my classroom straight before I would be out recovering for 3 weeks. All the time, my Samsung continued to glitch out like it has since I got it! While sitting on the couch recovering, I decided to deal with the phone issue again and EDGE UP. I figured 10 days latter, Linda would have taken care of the issue. Unfortunately, I faced the same problem and was told it was not eligible to edge up at this time. BACK on the phone again, 2 supervisors, 3 customer service reps. ( JOE from New York being the rudest customer service rep. I have EVER worked with) and 4 frustrating HOURS latter, Jason, the equally rude supervisor from Rochester, New York, informed me that Linda gave me BAD information, there was NOTHING he could do, and I am NOT eligible until April 14th!!!!! The WORST experience I have EVER had with a company. They were completely inept, rude, and not concerned about my time, my frustration, or the problems I was facing with their product in the LEAST. I have 4 LINES on Verizon that I am going to talk to Sprint about buying out. It was a horrible experience, and I can NOT believe I have no recourse or anyone to talk to....

    Edge has very clear restrictions, one being that you must have 6 months of clean payment history which you don't. Either wait until April 14, or good luck at Sprint.
    I am unsure how it can be determined the payment mix up was the fault of CS, but regardless, the mix up was done. There can be any number of reasons why a payment could be missed without any fault on your part, however you are still the responsible party for the account and must live with the repercussions.

  • Anybody knows how to bounce them off the edge of the frame ...

    I want them to change position randomly and smothly and also bounce off the edge of the frame. i will be so happy if you can help me.
    Here is the code:
    FlatWorld:
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    * This FlatWorld contains random number(between 1 and 10) of disks
    * that can be drawn on a canvas.
    public class FlatWorld
        // initialize the width and height of the Canvas in FlatWorld...
        final int WIDTH = 400;
        final int HEIGHT = 400;
        // create random numbers of disks (1-10) using array.
        Random myRandom = new Random();
        int numbersOfDisks = myRandom.nextInt(10) + 1;
        Disk myDisk[] = new Disk[numbersOfDisks];
        // The Canvas on which things can be drawn or painted...
        private Canvas myCanvas;
        * creates a Canvas and disks
       FlatWorld()
            //Creates our disks using array.
            for( int i = 0; i < numbersOfDisks; i++ )
                myDisk[i] = new Disk(WIDTH,HEIGHT);
            //creates a canvas and store it in the instance variable...
            myCanvas = new Canvas(WIDTH,HEIGHT,this);
       /* Draws our disks using array.
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawYourself(Graphics graphicsContext)
            for (int i = 0; i < numbersOfDisks; i++)
                myDisk.drawDisk(graphicsContext);
    public void change()
    final int movementScale = 8;
    for (int i = 0; i < numbersOfDisks; i++)
    int deltax = (int)( Math.random() - 0.5 * movementScale );
    int deltay = (int)( Math.random() - 0.5 * movementScale );
    myDisk[i].move(deltax, deltay);
    Disk:
    import java.awt.*;
    import java.util.*;
    * The Disk class is used to creates a disk with a random position
    * and a random color and a random diameter (between 1/20 width and 1/4 width)
    public class Disk
        /* instance variables */                    
        private int x;
        private int y;
        private int Diameter;
        private Color randomColor;
        private int red, green, blue;
         * Constructor for objects of class Disk
        //creat a disk at a 2D random position between width and height
        public Disk(int width, int height)
            /* Generates a random color red, green, blue mix. */
            red =(int)(Math.random()*256);
            green =(int)(Math.random()*256);
            blue =(int)(Math.random()*256);
            randomColor = new Color (red,green,blue);
            /* Generates a random diameter between 1/20 and 1/4 the width of the world. */
            double myRandom = Math.random();
            Diameter = (width/20) + (int)(( width/4 - width/20 )*myRandom);
            /* Generates a random xy-offset.
             * If the initial values of the xy coordinates cause the disk to draw out of the boundry,
             * then the x and/or y will change their values in order to make the whole disk visible in
             * the boundry. */
            int randomX = (int)(Math.random() * width);
            int randomY = (int)(Math.random() * height);
            int endPointX = randomX + Diameter;
            int xPixelsOutBound = endPointX - width;
            if ( endPointX > width)
                randomX = randomX - xPixelsOutBound;
            int endPointY = randomY + Diameter;
            int yPixelsOutBound = endPointY - width;
            if ( endPointY > width)
                randomY = randomY - yPixelsOutBound;
            setXY(randomX , randomY);
            /* replace values of newX and newY (randomX and randomY) into the x and y variables
             * @param newX The x-position of the disk
             * @param newY The y-position of the disk */
            public void setXY( int newX, int newY )
                x = newX;
                y = newY;
            /* Draw a disk by its coordinates, color and diameter...
             * @param graphicsContext The Graphics context required to do the drawing.
             * Supplies methods like "setColor" and "fillOval". */
            public void drawDisk(Graphics graphicsContext)
                graphicsContext.setColor(randomColor);
                graphicsContext.fillOval( x , y, Diameter , Diameter );
            public void move (int deltaX, int deltaY)
                x = x + deltaX;
                y = y + deltaY;
    }[i]Canvas:import java.awt.*;
    import javax.swing.*;
    public class Canvas extends JPanel
    // A reference to the Frame in which this panel will be displayed.
    private JFrame myFrame;
    // The FlatWorld on which disks can be create...
    FlatWorld myFlatWorld;
    * Initialize the Canvas and attach a Frame to it.
    * @param width The width of the Canvas in pixels
    * @param height The height of the Canvas in pixels
    public Canvas(int width, int height, FlatWorld sourceOfObjects)
    myFlatWorld = sourceOfObjects;
    // Set the size of the panel. Note that "setPreferredSize" requires
    // a "Dimension" object as a parameter...which we create and initialize...
    this.setPreferredSize(new Dimension(width,height));
    // Build the Frame in which this panel will be placed, and then place this
    // panel into the "ContentPane"....
    myFrame = new JFrame();
    myFrame.setContentPane(this);
    // Apply the JFrame "pack" algorithm to properly size the JFrame around
    // the panel it now contains, and then display (ie "show") the frame...
    myFrame.pack();
    myFrame.show();
    * Paint is automatically called by the Java "swing" components when it is time
    * to display or "paint" the surface of the Canvas. We add whatever code we need
    * to do the drawing we want to do...
    * @param graphics The Graphics context required to do the drawing. Supplies methods
    * like "setColor" and "fillOval".
    public void paint(Graphics graphics)
    // Clears the previous drawing canvas by filling it with the background color(white).
    graphics.clearRect( 0, 0, myFlatWorld.WIDTH, myFlatWorld.HEIGHT );
    // paint myFlatWorld
    myFlatWorld.drawYourself(graphics);
    //try but if --> {pauses the program for 100 miliseconds} dont work -->
    try {Thread.sleep(70);}
         catch (Exception e) {}
         myFlatWorld.change();
         repaint();

    Here is my contribution:
    FlatWorld:
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    * This FlatWorld contains random number(between 1 and 10) of disks
    * that can be drawn on a canvas.
    public class FlatWorld {
       // initialize the width and height of the Canvas in FlatWorld...
       final int WIDTH = 400;
       final int HEIGHT = 400;
       // create random numbers of disks (1-10) using array.
       Random myRandom = new Random();
       int numbersOfDisks = myRandom.nextInt(10) + 1;
       FlatWorldDisk myDisk[] = new FlatWorldDisk[numbersOfDisks];
       // The Canvas on which things can be drawn or painted...
       private FlatWorldCanvas myCanvas;
        * creates a Canvas and disks
       public FlatWorld() {       
            //Creates our disks using array.
            for( int i = 0; i < numbersOfDisks; i++ ) {
                myDisk[i] = new FlatWorldDisk(WIDTH,HEIGHT);
            //creates a canvas and store it in the instance variable...
            myCanvas = new FlatWorldCanvas(WIDTH,HEIGHT,this);
       /* Draws our disks using array.
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawYourself(Graphics graphicsContext) {
            for (int i = 0; i < numbersOfDisks; i++) {
                myDisk.drawDisk(graphicsContext);
    public void change() {
    final int movementScale = 8;
    for (int i = 0; i < numbersOfDisks; i++) {
    int deltax = (int)( Math.random() - 0.5 * movementScale );
    int deltay = (int)( Math.random() - 0.5 * movementScale );
    myDisk[i].move(deltax, deltay, WIDTH, HEIGHT);
    public static void main(String[] args) {
    new FlatWorld();
    FlatWorldDisk:
    import java.awt.*;
    import java.util.*;
    * The FlatWorldDisk class is used to creates a disk with a random position
    * and a random color and a random diameter (between 1/20 width and 1/4 width)
    public class FlatWorldDisk {
       /* Constants */
       private static final int DIRECTION_NW = 1;
       private static final int DIRECTION_N  = 2;
       private static final int DIRECTION_NE = 3;
       private static final int DIRECTION_W  = 4;
       private static final int DIRECTION_E  = 5;
       private static final int DIRECTION_SW = 6;
       private static final int DIRECTION_S  = 7;
       private static final int DIRECTION_SE = 8;
       /* instance variables */               
       private int x;
       private int y;
       private int diameter;
       private Color randomColor;
       private int red, green, blue;
       private int direction;
        * Constructor for objects of class FlatWorldDisk
       //creat a disk at a 2D random position between width and height
       public FlatWorldDisk(int width, int height) {
          /* Generates a random color red, green, blue mix. */
          red =(int)(Math.random()*256);
          green =(int)(Math.random()*256);
          blue =(int)(Math.random()*256);
          randomColor = new Color (red,green,blue);
          /* Generates a random diameter between 1/20 and 1/4 the width of the world. */
          double myRandom = Math.random();
          diameter = (width/20) + (int)(( width/4 - width/20 )*myRandom);
          /* Generates a random xy-offset.
           * If the initial values of the xy coordinates cause the disk to draw out of the boundry,
           * then the x and/or y will change their values in order to make the whole disk visible in
           * the boundry. */
          int randomX = (int)(Math.random() * width);
          int randomY = (int)(Math.random() * height);
          int endPointX = randomX + diameter;
          int xPixelsOutBound = endPointX - width;
          if (endPointX > width) randomX = randomX - xPixelsOutBound;
          int endPointY = randomY + diameter;
          int yPixelsOutBound = endPointY - width;
          if (endPointY > width) randomY = randomY - yPixelsOutBound;
          setXY(randomX , randomY);
          /* Generates a random direction */
          direction = (int)(Math.random() * 8) + 1;
       /* replace values of newX and newY (randomX and randomY) into the x and y variables
        * @param newX The x-position of the disk
        * @param newY The y-position of the disk */
       public void setXY(int newX, int newY) {
          x = newX;
          y = newY;
       /* Draw a disk by its coordinates, color and diameter...
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawDisk(Graphics graphicsContext) {
          graphicsContext.setColor(randomColor);
          graphicsContext.fillOval( x , y, diameter , diameter );
       public void move(int deltaX, int deltaY,
                        int width, int height) {
          int dx = Math.abs(deltaX);
          int dy = Math.abs(deltaY);
          int olddir = direction;
          int newdir = olddir;
          switch(olddir) {
             case DIRECTION_NW: { int newX = x - dx, newY = y - dy;
                                  if ((newX < 0) && ((y - dy) < 0))         newdir = DIRECTION_SE;
                                  else if (((newX) >= 0) && ((y - dy) < 0)) newdir = DIRECTION_SW;
                                  else if (((newX) < 0) && ((y - dy) >= 0)) newdir = DIRECTION_NE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_N:  { int newY = y - dy;
                                  if ((newY) < 0) newdir = DIRECTION_S;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     y =newY;
                                  break;
             case DIRECTION_NE: { int newX = x + dx, newY = y - dy;
                                  if (((newX + diameter) > width) && (newY < 0))       newdir = DIRECTION_SW;
                                  else if (((newX + diameter) > width) && (newY >= 0)) newdir = DIRECTION_NW;
                                  else if (newY < 0)                                   newdir = DIRECTION_SE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_W:  { int newX = x - dx;
                                  if (newX < 0) newdir = DIRECTION_E;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX;
                                  break;
             case DIRECTION_E:  { int newX = x + dx;
                                  if (newX + diameter > width) newdir = DIRECTION_W;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX;
                                  break;
             case DIRECTION_SW: { int newX = x - dx, newY = y + dy;
                                  if ((newX < 0) && ((newY + diameter) > height))     newdir = DIRECTION_NE;
                                  else if (newX <0)                                   newdir = DIRECTION_SE;
                                  else if ((newY + diameter) > height)                newdir = DIRECTION_NW;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_S:  { int newY = y + dy;
                                  if ((newY + diameter) > height) newdir = DIRECTION_N;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     y =newY;
                                  break;
             case DIRECTION_SE: { int newX = x + dx, newY = y + dy;
                                  if (((newX + diameter) > width) && ((newY + diameter) > height)) newdir = DIRECTION_NW;
                                  else if ((newX + diameter) > width)                              newdir = DIRECTION_SW;
                                  else if ((newY + diameter) > height)                             newdir = DIRECTION_NE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
    FlatWorldCanvas remains unchanged.
    Hope this will help,
    Regards.

Maybe you are looking for

  • Solution to "Quicktime Plug-in failed to load" error

    My solution to "Plug-in failed to load" error message when attempting to watch demo movie on Apple website (and others): I found two Quick-time plugin.plugin files in my Internet Plug-ins folder in my User Library folder. One was version 6.3 and one

  • Filter for Current_Date

    I was using a a filter of: Scheduled Date is greater than or equal to Current_Date However, I noticed that some data was not included. I suspect it is because of the default time that might be included when I use this filter. Does anyone know what th

  • Reinstalled skype and won't see my video calling

    I had to restore my computer to factory settings. I redownloaded Skype and signed in. But it the video calling is grayed out.  I had that before. How do I get it back?

  • Version 8

    How do I get back Itunes version 8. My computer is not compatible with the new Itunes 10

  • Accessing Child Dynamic MovieClips

    Dev Environment: Flash 9 Pro Alright, I have a movie that has one movieclip (imageHolder, this is defined in the Library and is an empty movieClip used as a place holder) which is on the stage. I read in and load images to the flash file, and create