How to create a transparent rectangle

Hello

I want to create a transparent rectangle that cannot cover the background image. Is that everything here can help me to revise the code?

Thank you

-Leo
    private Rectangle createSelectWindow(final Color color, double length) {
        //create a circle with desired name,  color and radius
        final Rectangle rect = new Rectangle(length, length);

        
        //rect.setFill(Color.WHITESMOKE);
        rect.setStroke(Color.WHITESMOKE);

        //add a transparent effect
        Blend blend = new Blend();
        blend.setMode(BlendMode.SCREEN);        
        blend.setOpacity(1.0);
        rect.setEffect(blend);
        //change a cursor when it is over circle
        rect.setCursor(Cursor.HAND);
        return rect;
}
Published by: leo November 22, 2011 12:45 AM

Unless you're doing something special here (I'm not sure what you mean by "does not cover the background image"), I don't think you need an 'effect '.

Try this:

private Rectangle createSelectWindow(final Color color, double length) {

        Rectangle rect = new Rectangle(length, length);
        rect.setFill(Color.RED);
        rect.setStroke(Color.RED);
        rect.setOpacity(0.5);  // i.e. make it 50% visible
        rect.setCursor(Cursor.HAND);
        return rect;
}

Or, if you do not want the border to be translucent and just fill, try this:

private Rectangle createSelectWindow(final Color color, double length) {

        Rectangle rect = new Rectangle(length, length);
        rect.setFill(new Color(1, 0, 0, 0.5));  // rgba - use an alpha of 0.5 on the fill color
        rect.setStroke(Color.RED);
        rect.setCursor(Cursor.HAND);
        rootPane.getChildren().add(rect);
}

Tags: Java

Similar Questions

  • How can I create a transparent rectangle to hide text? Driving me crazy!

    Hello

    I imported a logo to illustrator which is on a transparent background. I want to create a transparent rectangle that hides part of the logo, and then I want to put a new text on the hidden... text while keeping the background transparent. I tried different masks and gradient transpariences and nothing works! Attached is the image... try to cut out the word Boston and introduce a greater 'Boston' (same width but superiors characters) in the same place, with a transparent background. Now, Boston is too hard to read if the logo is small.

    Thank you!!!

    Boston Bus Journal 1.png

    See you soon,.

    Elizabeth

    Elizabeth,

    Assuming that the exisiting BOSTON mounting is not an option, you can:

    (1) create a nostroke/nofill rectangle that covers all word all, then give it a white fill.

    (2) in the palette flyout transparent tick do the with unchecked Clip opacity mask and mask Invert checked.

    That should clear the view BOSTON then you can retype.

    You could use a black fill and let the mask Invert unchecked (if black is black enough).

  • How to create a transparent background

    Hello guys,.

    I want to create transparent image or background, could you please help me how to create a transparent background image my Web site name is Digi Shiksha I want to post pictures on facebook for this I want to create a transparent image if you know tell me how to create a transparent image?

    You will also need to save in a format that supports transparency - as PNG. JPEG does not work.

    Dave

  • How to create a transparent background in Adobe Illustrator?

    I am doing a logo and save it as a PNG with a transparent background. It's for a Web site.  How to create a transparent background? Thank you!

    The background is transparent, unless you draw something.

  • How to create a transparent image for a Web site?

    Years, I have created a transparent image with Photoshop CS 5.5, but I forgot how I did it?

    Can someone offers a tutorial on how I can re - create the image of transparent Lake following please?

    Thank you

    See you soon!

    Betty

    transparent.jpg

    Yes, bevel and imboss, but if you want transparency for the web, you must create a png-24 file using the save for web dialog box: ctrl/cmd-shift-alt/opt-S.

  • How to create a transparent border

    Hello.

    I have two layers (icons). Among the ovelap icons either. But the layers are visually merged in this case.

    I created a stroke of whitesmoke around the heart icon. He made a turn, but doesn't look good when the icon is used on different backgrounds.

    So my question is: How can I make this transparent move?

    gel0i0ybr4.jpg

    The quickest way would be hold CTRL and click on the layer of heart to get the selection rectangle > select > modify > Expand add the thickness of the line, click Ctrl + Shift + I to invert the selection and select the layer of the sewing machine, click the mask at the bottom of the Layer palette. Once you have the mask place date back to the heart layer and hide the race... ?

    Hope this helps?

  • How to create a transparent png of sem

    I created a rectangle with corners rounded in Fireworks and I would like to save it as a transparent png, so that the central part of the rectangle is transparent, but the outside of corners is not transparent.  This is so that I can overlay on a background image to a Web page, which makes the image have rounded corners.  How can I do in the middle of the rectangle is transparent?

    Make a standard rectangle that is the same size as your rounded rectangle (or whatever it is, to display). The information panel is an easy way to ensure that the size and location is accurate.

    Use the layers panel, move the rectangle below your rounded rectangle.

    Select both objects, then go into the menu modify > combine paths > Punch. It will drill a hole of rectangle to round in your rectangle corners.

    (Punch punches of the superior shape in the lower order, that is why your existing rounded rectangle should be above your new standard rectangle in the stack of layers).

    Something like this (where I have the biggest standard rectangle rounded rectangle). Half upper picture shows the two individual forms. Half lower shows the standard rectangle with the rounded rectangle knocked out of him.

    But... what you can do is to select your image, copy (Ctrl-c), then select your rounded rectangle (or any shape), then go to the Edit menu > paste inside (or Ctrl-Shift-V). (It's a good technique when your image is exactly the size you want, you want just rounded corners).

    Or, you can do a white rounded rectangle, place it on the part of your picture that you want to display, select the rectangle and the image and go to the Edit menu > mask > Group as mask. (It's a good technique when your image is larger than the part that you want to display, but you don't know exactly what you want to do).

  • How to create a transparent Stroke in the text?

    I try to create an inner border around text which is completely transparent.  There is a line under the text that shows through.  I want transparency through this line.  It is a T Shirt and I need the color of the shirt to show through.

    The thing with piercing group, is have you group your text with your underlay.

    If it helps to look at the example file I was working I, here is a link to dropbox.

    There are two instances of the file - the other is not properly positioned external race, but you can rip it apart to see how it's done.

    Dropbox - clear stroke.ai

  • How to create a transparent stroke around a picture and text

    Hello

    I want to make the transparent white line. How would I do this in CS5?

    Thank you

    Photoshop Screenshot.JPGPhotoshop Screenshot White.JPG

    Hi undlou,

    Could you please follow the steps that might help you below:

    1. Create a stroke (any color) of the appropriate size for the form for which you wish to transparent race (although it will look like this, this is not exactly what you are doing to achieve this.)
    2. Separate this race on its own layer by double clicking on the styles of the shape layer and selecting "Create layers." Skip the rest for now.
    3. Now, it is on its own layer, Cmd-click form of the trait in the layers panel, which will choose the form.
    4. Invert the selection now shift + Cmd + I or select > Inverse upstairs.
    5. Select the layer below, which you will be masking the effect of STROKE separated layer.
    6. Select 'Add a layer mask' at the bottom of the layers panel.
    7. Erase the race effect layer.
    8. To clean things up, if you want, merge this layer with the top layer and all the effects of separate layer to create a layer.

    Concerning

    Sarika

  • How to create a transparent image (cut) on top of a solid?

    Hello. I try to use Pathfinder > less before creating transparent rays on the vectorization of text, but can't. Here is a link to how it should be: http://graphicmechanic.com/IMAGES/ingen.png. This is almost exactly how I'd like, but I want just so that when I put the graph on a picture the rays do not show up as a white but are rather transparent.

    If you want transparent or just went?

    If the latter:

    Make a trace of the rays, then copy text and paste in front of all (it is indicated, is not it?). The letters must also be a compound path.

    Then select the copy of text and the rays, take the pathfinder Panel and subtract.

  • How to create a transparent stroke above other forms?

    Hello

    I have the following form:

    shape1.jpg

    What I'm trying to do is to give the blue box a transparent line that 'cut' the red boxes and show that the background below, everything that can be... White, a different color, or a photo.

    I can easily achieve this when I give him a white. It will look like this:

    shape2.jpg

    When I change to one background color other than white or even a picture, however, I find myself with this problem:

    shape3.jpg

    How can I do so that I have a transparent border (not white) around the blue box? That effectively cuts stroke 'transparent' (space) between the parties where the blue and red boxes intersect?

    Thank you very much for all the tips I tried to get this done for days without success, then you are my last hope!

    1 Select the blue rectangle with the white line, and then do as suggested by Silkrooster to set the opacity of the stroke to 0. The white line will disappear.

    2 Select all three rectangles and group them.

    3. with the selected group, the appearance Panel must show:

    Group

    Content

    Opacity

    Click the opacity. In the box that opens, click the box next to the piercing group until the check mark appears. If the dashboard appears, click New.

  • How to create a transparent 3D object with some textured tasks (CS6)?

    So I want to find a way to create a 3D object without being all white and opac... I tried to decrease the opacity, but it decreases the other textures (layers) too...

    Thanks for the help!

    In the library of materials, make a click on the right where is the folder icon and choose 'New Texture'. Photoshop will open a new file for you. To design the texture of opacity, you should only use grayscale: Black will be transparent, white opacque, gray will be semitrasparent (the lighter to, the more opaque). Close and save you texture once you're done, you should see your object 3d with the transparent and opaque areas.

  • How to create a transparent logo?

    To explain this as easy as possible. I want to achieve the following.

    Create a form.

    Create a letter by a text layer.

    Create a clipping of the type layer mask so it appears inside the shape.

    Make the text transparent form of layer. So regardless of the origin, I put on the letter will always appear as if it's a cut-out shape.

    I want to do the foregoing, while keeping the form and text of vector objects layer. I don't know Adobe Illustrator, so this is my only way. So, someone please help me achieve this goal?

    Thank you very much!

    What I posted can be done:

    1. make your text and shape layers

    2. put the two layers in a group

    (select both layers and drag down on the icon of the folder at the bottom of the layers panel)

    (this way you can resize the layers by simply click on the group to the contrary having to select the two layers)

    3 set the blending options of the layer of text to zero fill and knockout shallow

    (press the small fx at the bottom of the layers panel for the merge options)

    So regardless of the layer is under the group, it is what you will see in the text

  • How to create a transparent box with only the colored border visible

    I'm trying to highlight something on a piece of data and I just have a simple box that describes the area of content that I am highlighting, but obviously the viewer must see through the content box.

    Cannot find anything on the elements to see how it's done.

    Thank you

    Doug

    If you want more control you can use the Rectangle tool and add a line with layer styles or lower opacity

    and then you can move, resize, or change the color at any time.

    Highlights:

    1. draw the retangle, double click on the shape layer in the layers panel to select the color and then lower the opacity of the layer to your taste.

    You can use the move tool to reposition the box or resize by clicking on one of the corner handles.

    Race:

    1. pull the rectangle.

    2. in the effects with Layer Styles Panel, choose visibility and hide

    (the color of the rectangle will be diappear)

    3. go to layer > layer Style > Style settings and choose STROKE from the dialog box.

    (you can choose the color and size of the line in the dialog box)

    MTSTUNER

  • How to create a transparent gradient?

    I use Photoshop Elements 8.  This could have a very simple answer, but I can't understand it.  I'm trying to take a layer and simply get a solid image to a transparent gradient, while it disappears gradually.  It's hard to explain, but I hope you understand.  Please let me know if you know how to do this.  Thanks to a bouquet.

    -TitanVex

    It would look somewhat like this:

    IIIIIIIIII IIII II I I I I

    IIIIIIIIII IIII II I I I I

    IIIIIIIIII IIII II I I I I

    ^                                      ^

    Solid picture

    Part of gradually

    Picture disappears

    If that makes sense.

    Is that what you are looking for?  I used the method of Group of clipping that mentioned Terri.

    1 added an empty layer below the photo layer and grouped the 2 layers.

    2 set the gradient options: linear, to the first plan of Transparent

    3. calls on the gradient of approximately 1/4 from the edge left completely to the right edge.

    You can continue to draw the gradient with different staart and endpoints until you get the desired result. Just a matter of trial and error.

    I added the white layer so that you can see the results.

Maybe you are looking for

  • Firefox v. 38.05 does not install

    When I check for updates of v.38.01, Firefox offers 38.05 as the last version, but still fails to install

  • Satellite 1900-102 BIOS necessary

    After being hit by a rather nasty virus (long story, but my son went online with the firewall disabled) my bios on my satellite 1900-102 has been damaged and I can't re-boot, also some programs no longer work. Where can I get a download of the Bios f

  • How can I cancel Apple music family subscription?

    I want to cancel the family membership of music Apple.

  • Photosmart 5524 print all PDF

    My 5524 will only print a few pages of a PDF and then gives a message "unable to print the document.  It is connected wireless to a new PC for Windows 8.1.  I also have a Photosmart 2575 connected to my router via a network cable wireless and that pr

  • HP Pavilion 15 laptop: upgrade RAM

    Hello I want to upgrade RAM of my laptop. Should what kind of product I buy? Specifically, please. I would like to expand the capacity of the RAM as much as possible. It's the number of the product you need: F9G45EA #ABZ. Thank you very much. Best, M