Draw line over Image??.. in Grid Format

Hello frnds,
what i want to do in my project is to draw image on JPanel with grid lines.. ??
May be image in background and lines over image..
I searched forum before but coulnt find appropriate thread.. please help me out??
gervini

from within the JPanel's paint() method.In Swing components you should overide the paintComponent() method, not paint().

Similar Messages

  • Lines over images and around text in Captivate SWF file

    My project works & views fine in captivate and when published, it views fine on my mac - through flash player and browsers. But when I send a swf file to the client to view they see odd lines above and below images.
    But they dont see the lines when they view the htm file within a browser - then it views fine.
    The lines only appear when there's text over an image.
    Screen shots attached.
    My captivate project was created by importing a Powerpoint document, with images and text on each slide.
    I've changed the optimisation / slide quality through prefrences and on each slide to the highest quality.
    I've also un-selected the advanced slide compression.
    Is there another thing I can try to iron out these lines?
    Some of the images within Powerpoint are stretched, would this cause the lines?
    Is it a flash player issue?
    Or a zooming issue?
    Any help is much appreciated!

    Thanks Lilybiri,
    I am a new user & just finding my way
    I understand how to publish and how Captivate creates a zipped file with a SWF, HTML, JS and CSS files etc. (Im using Captivate 7). 
    How do you send Captivate projects to clients for review / approval before you supply them with the whole project zipped file?
    So far I've been sending them the swf file to check. And have had troubles with them viewing the lines over images and around text. Even though I cant see the lines.
    I need the client to see what I'm seeing - a project without any lines.

  • Gray Lines Over Image

    HELP! I have to get this DVD burned ASAP! I created a menu through after effects, but then exported a still to use as the main menu to prevent the whole animation menu to play each time you go to select a different video. The animated menu came out fine, but the still image has two big gray lines over it: one on the top and one on the bottom of the image. My only guess was that it's watermarked, but I don't have watermark enabled. What is going on and how can i fix it?

    Hi
    What size in pixels is your still? Without seeing it I guess could be a resizing problem.
    Hope that helps !
      Alberto

  • How can I arrange bookmarks in a grid format instead of a vertical line?

    Windows has a IE Favorites folder, containing favorite websites, and all of these favorite website folders and links can be viewed in a grid format (spread horizontally and vertically). Firefox Bookmarks: I can only get to display in a very long vertical line. Is there an internal file folder containing all of my Firefox Bookmarks? And if so, can I display them in a grid? Thx.

    Sorry, no there is no way to arrange or view bookmarks in multiple columns or a grid built into Firefox.
    Bookmarks aren't stored in a folder in Windows like with IE, they are stored in a database file named '''places.sqlite''', along with browsing history and downloads history.
    There have been a couple of different extensions available over the years that did display bookmarks in multiple columns, but those extensions were short lived and never were really finished before the developer lost interest and stopped working on them.
    Suggestion - folders within folders will spread out to the right, somewhat in a "columns fashion" across the screen. But with the current placement of the bookmarks button I don't know how well that would work; I haven't even tried it out. Personally, I have used the Bookmarks Sidebar for viewing my bookmarks since I started using Firefox in 2002.

  • Draw a line over a JLabel

    Hello,
    Does anyone know if there is a way to draw a line over a JLabel. The scenario is that I have a Jpanel that uses a Gridbaglayout and has an array of JLabels(to display images). I have the need to connect labels and to have the line draw over any labels that it intersects.
    I know this can be done if you use the same graphics context to draw the image and the line, but since I need to use JLabels and the graphics context that draws the line is a JPanel's, I have a problem.
    Is there a way to draw a line over a JLabel?
    Thanks
    lon

    Easiest thing to do would be to override paintChildren like
    public void paintChildren(Graphics g) {
      super.paintChildren(g);
      //paint your line here
    }That should do what you want - paint the children first and then draw over them

  • Drawing a straight line over a video

    Is it possible to draw a straight line over a video in CS6 and also to watch the video frame by frame to take exact timings?

    Hi Jeff,
    Back again! i have managed to put the line over the video and can have it on there as long or as short time as i wish, but it appears to be moving with the video and i need it to stay at a certain point and the video to carry on playing. Basically im trying to mark a point on a race track where the horse in the lead gets to, then i need the line to stay there for when the last horse comes to the line, with the lead horse moving on past. Currently the line doesnt stay on a specific point it on the video and go out of shot when the video moves, it appears to be moving with the video. I know the overlay is a static image but is there a way of making it look like it stays in a specific place on the video?
    Hope this makes sense!
    Thanks Kat

  • Saving Image Files on Disk after drawing lines on the Image

    Hi guys,
    I am presently working on a swing project in which I need to draw lines on a image and then store the modified image in .gif, .jpg or .bmp file format.
    I can't seem to find an documentation dealing with this situation.
    Any help will be highly appreciated
    Abhi

    Ive just been looking for the same. Theres an article (and a class) on javaworld on subject of saving bitmap-files, and in another thread in this forum, a guy described how to make jpg. with the jdk1.4 .... Like this:
    int w = comp.getWidth();
    int h = comp.getHeight();
    BufferedImage im = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = im.createGraphics();
    comp.paint(g2);
    g2.dispose();
    ImageIO.write(im, "jpeg", new File("foo.jpeg"));
    im.flush();
    Im just referring, havent tried it yet. Good luck.
    Stig.

  • Grid lines over audio tracks

    How can I view the grid lines over/thru audio tracks?

    Yea, that would really be a useful feature.
    My work around has always ben to put a blank track above or below (or both) the track being edited. That way I can see transients against the grid lines, as they appear above and/or below the region.

  • Translucent gray over image in thumbnil (grid) view

    See example image below:
    one thumbnail looks OK (on left), but other, problem image (on right) has translucent gray layer over image!
    The problem images are not in a stack.
    If I click the problem image thumbnail it looks normal, but the gray overlay re-appears if I click on anther image.
    It shows OK in develop module.
    I know this is probably something stupid, but...can anyone help identify what is happening?
    -Colin

    Most probably you have flagged the image as "rejected" by pressing "X" on your keyboard.
    When an image is flagged as rejected it gets that grey overlay that disappears when you select the image. You can still edit them in the Develop Module.
    To delete the "Rejected" flag, select the images with the grey overlay and press "U" or "P" on your keyboard. "U" stands for "Unflagged". "P" stands for "Picked".

  • How do I assign images to grid cells based on their random number value?

    Hello everyone!
         I need a good point (or shove) in the correct direction.
    Background
         I've created (with previous help from this forum) a 12 x 9 random number grid which cycles through the numbers 1 to 9 a total of twelve times each. I've then created a button which shuffles the current grid's cells each time it is clicked. I now want to use 9 images that I have imported as individual symbols into the library (I have given them each their own class titled "skin1," "skin2," ... "skin9") as cell labels or the equivalent. I have also set the images up as individual movie clips (using the .Sprite class as the extended base class but keeping the actual image class names in line with their object name, i.e. the "skin1" image is the "skin1.as" class).
    Question
         How do I assign these images to the grid cells based on their respective values (ranging from 1 to 9) and have them populate the grid each time I click the "shuffle" button? So for example, in my grid the numbers 1 through 9 randomly appear 12 times each. Every time the number 4 appears in a cell, I want it to be assigned to the image "skin4" (which is just a graphic that looks like a button and has a fancy number "4" printed on it). Below is a chunk of the code I am using to draw the grid cells with:
    // Creates a grid cell when called by generateGrid().
    private funciton drawCell(_numeral:int):Sprite
              This is the code I am currently implementing to populate the grids with (although I
              don't want to use text labels as I want to fill each grid with an image according
              to its numerical value (1 to 9).
         var _label:TextField = new TextField();
         _label.multiline = _label.wordWrap = false;
         _label.autoSize = "center";
         _label.text = String(_numeral);
         // Add numerical label to cell array.
         cellLabels.push(_label);
         var _s:Sprite = new Sprite();
         _s.graphics.lineStyle(2, 0x019000);
         _s.graphics.drawRect(30, 0, cellW, CellH);
         _s.addChild(_label);
         return _s;
         While the following isn't working code, it will hopefully demonstrate what I want to achieve inside this function so I don't have to use the above snippet for text labels:
         //This will "hopefully" create an array of all 9 images by calling their classes.      var _imageArray:Array = [skin1, skin2, skin3, skin4, skin5 , skin6, skin7, skin8, skin9];      // This is what I want to happen for each cell using the above image array:      for (i = 0; i < cells; i++)      {           if (_numeral == 1)           {                // Insert skin1 image for each instance of #1 in the grid.           }           if (_numeral == 2)           {                // Insert skin2 image for each instance of #2 in the grid.           }           ...           if (_numeral == 9)           {                // Insert skin9 image for each instance of #9 in the grid.           }      } 
         Again, I don't want to use text labels. I have a custom skin graphic that I want to go over each number on the grid based on its numerical value (1 to 9). Any help with this is much appreciated!

    kglad,
         Thank you for your help with this one. Using the code below, I have successfully populated my grid cells with the desired corresponding graphics. I noticed one thing though regarding my use of the shuffle button with this particular implementation: even though the numerical values residing in each cell get shuffled, the original images remain in the grid rather than being replaced by new ones. The first code snippet below is the revised cell drawing function including your help; the second snippet shows you my simple shuffle button function (where the problem lies, I think).
    Snippet #1:
         // Creates a grid cell when called by generateGrid().
         private function drawCell(_numeral:int):Sprite
              var _label:TextField = new TextField();
              _label.multiline = _label.wordWrap = false;
              _label.autoSize = "center";
              // Creates a label that represents the numerical value of the cell.
              cellLabels.push(_label);
              var _s:Sprite = new Sprite();
              _s.graphics.lineStyle(2, 0x019000);
              _s.graphics.drawRect(30, 0, cellW, cellH);
              // Physically adds the labels to the grid.
              _s.addChild(_label);
              // Assigns a graphic class to a cell based on its numerical value.
              var _classRef:Class = Class(getDefinitionByName("skin" + _numeral));
              // Undefined variable for holding graphic classes.
              var _image:* = new _classRef();
              // Lines the images up with the grid cells.
              _image.x = 30;
              // Physically adds a graphic on top of a cell label.
              _s.addChild(_image);
              return _s;
         So far so good (although I question needing text labels at all if they are just going to remain invisible underneath the images, but enough about that for now). This next part is the reason that the images won't shuffle with the cell values, I think.
    Snippet #2:
         // When shuffleButton is clicked, this event shuffles
         // the number array and fills the cellLabels with the new values.
         private function onButtonShuffleClick(e:MouseEvent):void
              // Shuffles the number array.
              shuffle(numbers);
              // Verifies the array has been shuffled.
              trace("After shuffle:", numbers);
              // Loop replaces old cellLabels with new number array values.
              for (var i:int = 0; i < cells; i++)
                   cellLabels[i].text = String(numbers[i]);
         As you can see, it never replaces the original images that populate the grid. I tried using the _s.removeChild(image) function but that didn't work, nor would copying/pasting some of the code from snippet #1 directly into this function as it would cause another instance of the images to be placed over top of the existing ones rather than actually swapping them out. Any continued help here is greatly appreciated!
         PS Is there a quicker method for posting code into these forums without having to type it all out by hand again (i.e. copy/paste or drag/drop from my .fla or Notepad file directly into this thread)?

  • Mouse moving crosshair over image problem

    Hello,
    I� am quite a newbe at Java and using the trail and error development method (or copy and paste method) �
    Now I� am facing the following problem:
    I made a program with an image that is draw out of received data. After that I want to draw a huge cursor crosshair (two lines at image size) over that image. It should move when I move my mouse.
    I can�t get it done by redrawing the entire image every mouse motion. That will result in a slow motion crosshair.
    The program start with:
    public class MyProg extends javax.swing.JFrame {
    Container cont;
    public byte[] BulkIn = new byte[6000];
    public DrawField drawscreen;
    public CrossHair crosshair;
    /** Creates new form MyProg */
    public MyProg() {
    drawscreen = new DrawField(BulkIn);
    �.
    The DrawField part (where the image is drawn) start like:
    class DrawField extends JPanel implements Printable {
    byte[] BulkData;
    Lines BlueLine,RedLine,WhiteLine,GreenLine,CyanLine,YellowLine,OrangeLine,PinkLine;
    static BufferedImage imgs;
    static BufferedImage raster;
    static BufferedImage buffImg;
    �..
    The CrossHair part starts with:
    class CrossHair extends JComponent{
    Container cont ;
    int x_Pos,y_Pos;
    int x_offset,x_end,y_offset,y_end;
    public void paint(Graphics g) {
    g.setColor(Color.yellow);
    g.drawLine(x_offset,y_Pos,x_end,y_Pos);
    g.drawLine(x_Pos,y_offset,x_Pos,y_end);
    �.
    Now, when I reach crosshair.repaint(); nothing happens.
    When I change "class CrossHair extends Jcomponent" into "class CrossHair extends Jpanel", the crosshair is drawn perfectly, however, my original image is gone.
    My intention was to draw the crosshair on some kind of glasspane, but until now with no success.
    Help!

    You'll have to redraw everything each time you reposition the cursor.
    Your best bet to speed things up (and look nice) are:
    1. Use double buffering
    2. Redraw only over the area where the cursor needs to first be erased (ie might only be a 30x30 area). You can achieve this by setting the clipping area of the pictures drawn.

  • How to draw lines in FCPX ?

    Hi there,
    I would like to have a simple Effects that will draw lines in various shape such as circle, ellipse or rectangle. How do I do it ?
    I need it because I want to have an effect that is drawing an ellipse over the text.
    Any ideas ?
    Thanks

    ok... hmmm...
    You can create control points for a line but you cannot animate the control points in FCPX. If you're okay with that, then here are the basics:
    Create a new top level group. Name it OSCs.
    In the Inspector, select the group and in the Group tab of the inspector, select Fixed Resolution. (It should already be set to 2D - if not - set 2D)
    In the Properties > Timing pane, set the length (Duration) of the group to at least as long as your project. (this step is not important in Motion but absolutely necessary for FCPX!)
    With the new group selected, add the filters you will use as control points. In general, every starts with Filters > Distortion > Poke. You will need two of them. For each Poke filter, select Publish OSC in the inspector. (I recommend renaming each filter - startOSC, endOSC for example.)
    Create another new group.
    Go into the Library > Content and search for Crosshair -- there's three of them, use Crosshair-Minute (they're the smallest ones.) Add two of them. (It's not necessary that they're in their own group -- just more convenient.) Rename the crosshairs: keeping with the OSCs, I recommend start and end, for example.
    Draw a Line.
    To the shape (line), add two Behaviors > Shape > Track Points.
    Rename the Track Points: Start and End.
    In the Behaviors inspector for the Track Points, drag the start Crosshair image into the Source well of the Start track points and the end Crosshair image into the End Track Points. The behavior parameters will change and you'll see a bunch of new stuff. Down at the bottom, you'll see Track 1 and Track 2 — leave one checked for one of the behaviors and the other one checked for the second behavior (that's 1 track 1 and 1 track 2.) You'll also see that the Transform is set to Mimic Source.  What you need to do is click the reset button on the Checked Track of each behavior and THEN change the Transform to Attach to Source. Once you do that, the line ends will snap to crosshair images (use Properties Transform X to move the crosshairs apart temporarily.)
    Next step:
    Select the start crosshair and in the Inspector > Properties, dial down the Position to reveal the XYZ parameters. Right click on the X and select Add Parameter Behavior > Link.  Repeat this step for the Y parameter (you cannot link Position.All for this step.)
    In the Behaviors inspector, for the start crosshair:
          For the Source Object, drag the OSCs group into the well.
    for the X parameter
          For the Source Parameter, set Filters.startOSC.Center.X for the Position.X
                                                 and set Filters.startOSC.Center.Y for the Position.Y
    You will notice the line end disappear off the screen. This is normal. To correct this, at the bottom of each behavior, set the X (or Y) offset to -0.5.
    Repeat for the end crosshair.
    You can turn off the crosshairs (uncheck the layers.)
    To test your OSCs, select *both* startOSC and endOSC (command select each layer) -- both Poke OSCs will appear and you can drag them around the canvas. The line should follow as you would expect if you've set everything up correctly.
    Publish the template.
    A couple of explanations:
    2D fixed resolution for the OSC group:  Groups in Motion that are not fixed resolution can dynamically change their boundaries. There are no fixed points of reference for Motion to calulate. If you forget to set Fixed Resolution, you can repair the condition by setting the Fixed Resolution option and then go into the Filters pane and reset the Center parameters for each Poke OSC.
    Offsets of -0.5:  All resolutions in the Canvas are calculated by the resolution of the X and Y dimensions of the project times the fractional position of objects (from 0.0 on the left side for X and on the bottom for Y — to 1.0 on the right side for X and on the top for Y.) The center of the canvas is 0, 0 in pixels of whatever the resolution is.  To adjust the fractional position used by the OSCs (and others) to the center pixel, the value needs to be moved by 1/2 of that distance.
    Clear as mud?  Once you've done it a few times, it will all become second nature.
    One more thing: you can publish curves... complex ones. But they have to be B-spline (you track all the points in a similar manner outlined above) and not Bezier. There's no way to control the handles for bezier curves.

  • Image size and format for IMovie

    I am trying to make a short stop motion animation in IMovie. I have made my images in Adobe illustrator. I transfer the images into IMovie as JPEGS.the images, which are basically line drawings, look sharp and clean but as soon as you watch them as moving pictures they become broken up.
    what am I doing wrong? does this have to do with my image size or format?

    iDVD will try to downsize the image to work, but your TV often will overscan with the result being edges clipped off. The amount of clipping can vary, so the "TV Safe" settings will typically be the center 80-90% of the image. So, if you add a border that makes the image 10-15% larger, that should display the whole image. For example, if you had a 150 dpi image that was 640x480, you could put a 10% border on it so the final image was 704x528.
    John

  • Photoshop CS4 - When I pullled up a file, JPEG logo someone sent to me, the screen has cross thin green lines over it. What is that? How do I remove it?

    Photoshop CS4 - When I pullled up a file, JPEG logo someone sent to me, the screen has cross thin green lines over it. What is that? How do I remove it?

    JPEG files are not layered files they are just image files so the green lines are a part of that file.
    Usually cross lines are added to prevent anyone from using the file without proper rights, its a way of safeguarding the artwork.
    You have to ask the owner of the file to remove the lines for you.
    hope this helps
    thanks

  • Trouble drawing on saved images in whiteboard, please help!

    I use the Image.IO.write(image,"png",file) method to save my whiteboard drawings onto a file and it displays fine when I import it. But when I draw on it it seems some of my whiteboard buttons are "blending in" with the drawing area where the image is. I guess a way to imagine is there is a row of buttons then a panel containing the image. When I draw on the image area the image of the bottons above are mixed in and everything looks bad. Any idea what I am doing wrong in saving the image? thanks!

    Yes, I see the big ugly squares. They are what appears whenever extremely heavy JPEG compression is applied to a low-resolution image tht has relatively large areas of similar colors. Something somewhere is applying such compression to the pages, or portions of them, that you are viewing in your browser(s). Your MBP is not doing that: it can't. Either the page images (or parts of them) are being compressed by the website owners or, if every web page is affected, they are being compressed by your ISP in the process of being transmitted to you, as Gordito suggests. That would greatly increase the speed of page loading, but at the expense of image quality. You wouldn't see the image degradation on an iPhone or cell phone — the screen is too small — but on the MBP's high-resolution display it would be much more apparent, IF the MBP were receiving the signal in the same highly compressed form as the phone. If the MBP receives the same web pages through an ISP that doesn't over-compress them, they'll look the way they ought to look. So if you are receiving these web pages through a cellular ISP rather than through a broadband connection, take the MBP to a wifi hotspot and connect through wifi instead. I bet things will look different then.
    Compressing images is something a web browser can't do: a browser just displays the signal that comes to it.

Maybe you are looking for

  • Apps open and close all of the sudden

    Ok, my iphone was working fine until 10 minutes ago. I had no issues with it and all of the sudden, I tried opening up an app and all it will do is just open and close all of the sudden. And it's with ALL apps! I tried doing everything there is to do

  • Sql database connection in jsp

    Hi, I am new to java. I know how to connect the database in the java using the javacodings [jdbc] but i am don't know how to connect the database using the jsp. Is it easy. If so, can any one help me in this regards. Any sample codes or white paper a

  • Regarding Remote function module ARCHIV_CONNECTION_INSERT

    Hi All, Can any give me more detial about remote function  module ARCHIV_CONNECTION_INSERT . So i have requirement that our client is archiving document from Commonstore. So want to create custom function module for TOA01 ( ZTOA01 ) and add a maintan

  • [Q] Oracle Spatial Java Class Library: classes missing ?

    Hello ! We are using Oracle 9.2.0.4 with Spatial features and we'd like to use the Java Library to get access to the object Geometries. We have downloaded the Spatial Java Library at: http://www.oracle.com/technology/software/products/spatial/index.h

  • Auto Install 3.1 AIR runtime instead of 3.2 on few computers

    Hi, We have a flash badge that install AIR and the app http://apps.facebook.com/djplayer/ , the app need 3.2 but on one specific computer it always install 3.1.0.4880 and so the install fail and we dont understand why this happen. (do not happen on a