Placing a semi-transparent area on top of a picture

CS3
I need to place some text on a photo, and to make it possible to read the text clearly, I want to place an area with a single colour on top of the picture - and the text on top of the are.
But how can I make this area semi transparent?
Thanks

There is also an action under Text Effects that does a semi-transparent panel for text.
Load the Text Effects actions into your actions panel and then make a selection for
the size of the text panel (rectangular marquee tool) before running the action. After
the action runs you can type your text inside the panel.
You can move the text layer and panel layer to a different part of the image by
selecting both layers and then using the move tool.
MTSTUNER

Similar Messages

  • Cloning Semi Transparent Areas

    Is it possible to clone a semi transparent area of an image without the effect being multiplied?

    You could merge a copy of the layer with white and then use
    peel off white to make it transparent again when you're done. Seems awkward, but works.

  • Semi-Transparent Overlay's on Text, Tables, Pictures

    Hi, I'm new to Keynote. I wanted to create a table in which certain portions of the table are more visible than others. How can I do this? I was thinking about some sort of semi-transparent overlay.
    Here's an example:
    Also, how can I do this for text in Keynote such that my current text sentence is visually set apart from previous text on a slide.
    Here's an example:

    The first issue can be handled by setting the colour of the text and borders to a colour that you have made semi-opaque. Select the cells you want to change, then in the Text Inspector, click on the text colour to bring up the Colours Palette. Choose the colour, and then at the bottom of the palette use the opacity slider to change the opacity of the text to what you want. You can now drag that colour from the area at the top of the palette to one of the "swatch" squares at the bottom, so you can easily re-use it. Now go to the Graphic Palette, click on the stroke colour to bring up the Colour Palette again, and just click on the newly created swatch to set the lines to the same colour.
    For the effect with the bullet points, you can either do a similar thing with the colour, or you can try using a Build In using the Delivery methods of "By Highlighted Bullet".

  • Restoring opacity to transparent areas?

    Hi all.
    Is there a way to restore lost opacity to a layer? Let's say I have a semi-transparent area, and want to bring the opacity there back to 100%.
    Thanks. :)

    If by "hard erase" you mean a 100% transparency erase, where there is no trace of the original pixels remaining, then yeah... As John Nielsen mentioned, these "hard erases" destroy the pixel color information, so you can't bring them back (unless you fake it via Snapshots or History or something, as you mentioned).
    But what I need is a way to paint back lost transparency in images (such as PSD's, which are what I work with mostly) without having to rely on History, etc, since I may close and reopen later.
    A typical example would be some photo that I'm working on, which I save and re-open, then say, "Hey, wait a minute... I don't like the cut around this person's hair. I need to restore some lost transparency here." So, if it's not a "hard erase", I can either select it and do Layer Via Copy a bunch of times, then Merge Visible, or fake it with Snapshots (if I still have a good one - I usually crop somewhere along the line, so that throws things off a bit).
    It would just be a whole ton easier if there was a way to "paint" the transparency back on, like you can when using divine Layer Masks.

  • My pictures are being placed in the inappropriate events; like laying on top of other pictures.

    HELP  and THANKS    I am in  iPhoto. I have 29,000 pictures.  I have about 1500 events.  I have dragged a very few if these pictures from the internet.  I have dragged one picture from Facebook,  I have received eMails with pictures that I have put in iPhoto library.  I have also brought pictures from the  iPhone into my iPhoto library.
    A problem has recently emerged.  Three of the pictures which I have dragged into my iPhoto library have superimposed themselves upon photos which were already in the library.  When I double click on any one of these three recently imported pictures to get an enlarged view of it, the picture that becomes enlarged is not the one that I just double clicked . . .it is a pre-existing photo in my library.  This phenomenon suggests to my mind that that the (recently imported) photo on which I just clicked has somehow superimposed itself over the pre-existing photo.  ?????   What a strange dilemma!   HELP.
    This is the problem and a recent problem.  I have three separate pictures that I have brought into the library that are causing a problem. One is from the Facebook, one is from an eMail, one is from a library file that I bought online. They have perpetuated, that is they have placed themselves on top of other pictures in many events.  The said pictures can be seen  and have been renamed the file into which they are going and going and going.  When I click on the said pictures up comes the original picture that has the event name.  I have tried to trash the picture and bring back the pictures only to find the returning problem.  Please someone please help.  The problem is that one picture is superimposed upon another picture.
    I took my computer to SimplyMac and they reloaded the thumbnails and said that would fix the probable. It didn't!  Now what! 
    Thanks again!

    If Larry's suggestion doesn't help the situation 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 (Snow Leopard and Earlier).
    or with Lion, Mt. Lion or Mavericks delete the contents the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder.
    3 - reboot, launch iPhoto and try again.
    NOTE: In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    If you're running Mavericks, 10.9,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    where you can check the Show Library Folder checkbox.
    OT

  • When using one of the Windows 7 (32x) Aero themes, PDF's are displayed semi-transparent.

    I can't read PDF's in my Firefox browser anymore. It looks as if they are semi-transparent: The fonts are blurry, and they have the same color as my Aero theme frame. I can see my desktop photo through the fonts. When I save the PDF's and open them offline, they are displayed as they should. The prints also look normal. Btw, when I change to a classic theme, PDF's are displayed normal.

    this problem also posted here: https://support.mozilla.com/en-US/questions/863361

  • Can anyone tell me why games are semi transparent in Pogo? I only have this problem with Firefox but not with IE9 or Chrome

    When I click on a game, the game window opens and is solid, but when it's fully loaded, it becomes semi transparent and washed out. I can post a screen shot of what I'm talking about if this forum supports it.

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • Wow! CS6 let's you click through transparent areas in placed psd's!

    I just noticed this, this is great!
    If you cut out the background of a photo in PS and then place that in AI, you can now select things behind it as long as you click on a transparent area. Knowhattamean? Before, in CS5, if you clicked there you would still select the PSD.
    Is there a list somewhere of all the improvements in AI CS6? You know the "little things"?

    Actually, no. I thought that for a moment too. If I had Select Object by Path Only selected then I would be able to select a psd only by clicking on the outer border of it.
    At some point when I first installed AI CS6, I was able to select the psd by clicking anywhere on the psd that wasn't transparent. And clicking in the transparent areas had no effect.
    I thought that was great. And that's what I lost and am trying to get back again.

  • Code to make area semi transparent?

    Is there a way to modify the following background color code to make my background color semi-transparent so that an image in the background shows through?
    Thanks.
    #logo {
    background-image: url(img/logo.png);
    background-repeat: repeat-x;
    background-color: #FFFFFF;
    margin: 0 auto;
    width: 1100px;

    Have you got Fireworks?
    If so open a new file and make the documents background color transparent.
    Draw a small square and color it in with a solid colour which is in the same shade range as the color you want the final background of the #logo <div>.
    Select the solid color and use the transparent box in the properties inspector to adjust the colour to suit. It may be best if you bring in your image and position it behind the colored square so you can see what the color looks like when you adjust the transparency of the color.
    Once you have adjusted it to the color required delete the image and then export a small 1px x 1px piece of the colored square. Use PNG8 with alpha transparency or PNG24.
    Use the colored square as the background image to the logo <div> instead of the logo image itself and insert the logo image directly into the logo <div>

  • Exporting text with a semi transparent background that can be changed in PS or PP?

    I'm creating a logo with a semi transparent background that I want to place on top of photos in Photoshop and videos in Premiere.
    1. I do not see a transparent option when exporting as a .tiff. Is transparent .png my only option from AI?
    2. I will need different amounts of transparency for the background depending on the image or video it is being placed on. Is there a way to export this and still have control in Photoshop or Premiere of the amount of transparency to apply towards the background?
    Thanks!

    1. So you are suggesting to just copy from AI and paste into PS?
    2. Since the logo is text and the background is a rectangular shape, I need to make sure that I can lower the opacity in PS or PP independently of the text. I will have to do a test later, I do not have the file on this computer.
    Thanks.

  • An Image JPanel, A semi-transparent JPanel, and non-opaque components

    This is a more intelligent re-asking of the question I posed here: http://forum.java.sun.com/thread.jspa?threadID=579298&tstart=50.
    I have a class called ImagePane, which is basically a JPanel with an image background. The code is much like the ImagePanel posted by camickr, discussed in this topic: http://forum.java.sun.com/thread.jspa?forumID=57&threadID=316074 (except mine only draws the image, it does not tile or scale it).
    On top of my ImagePane, I can place another component, TransparentContainer. This again extends JPanel, only a color is specified in the constructor, and it is drawn at about 70% opacity. This component is meant to help increase the readability of text components that blend with the background image, without blocking out the background image completely.
    This works very well, until I need to add a component, like, say, a non-opaque JRadioButton in a ButtonGroup. When you select a new JRadioButton at runtime, the semi-transparent JPanel fills with a combination of a completely opaque color (the one specifies to the TransparentContainer) and garbage from the non-opaque component being redrawn.
    I have noticed that the UI is restored to being non-messed up if you place another application window on top of it and then move it. So apparently, one solution is to redraw the entire UI, or just the part that has the JRadioButton on it, every time the radio button is clicked. However, this seems unnecessarily complicated. It seems to me that I am missing something in my TransparentContainer's paintComponent() method. Does anyone have any ideas?
    Here is my TransparentContainer code, if it will help:
    import java.awt.AlphaComposite;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import javax.swing.JPanel;
    public final class TransparentContainer extends JPanel
         /* Private Fields: For use only by this class.
          *  These fields hold information needed by more
          *  than one method of this class.
         private boolean fullTransparencyEnabled;
         private Color baseColor;
         private Color outerBorderColor;
         private Color innerBorderColor;
         private int obw;
         private int ibw;
         private int cbw;
         /* -- START OF METHODS -- */
         /* public TransparentContainer(Color color, boolean fullTrans)
          *   Initiallizes the transparent container object
          *   with 'color' as its base color.
         public TransparentContainer(Color color, boolean fullTrans)
              fullTransparencyEnabled = fullTrans;
              baseColor = color;
              Color borders[] = findBorderColors();
              outerBorderColor = borders[0];
              innerBorderColor = borders[1];
              obw = 3;
              ibw = 1;
              cbw = obw + ibw;
         /* private Color[] findBorderColors(Color base)
          *   Calculates the colors for the outer and inner
          *   borders of the object based on the base color.
         private Color[] findBorderColors()
              Color borders[] = new Color[2];
              int colorData[] = new int[9];
              colorData[0] = getBaseColor().getRed();
              colorData[1] = getBaseColor().getGreen();
              colorData[2] = getBaseColor().getBlue();
              colorData[3] = colorData[0] - 50;          // outerBorder red
              colorData[4] = colorData[1] - 45;          // outerBorder green
              colorData[5] = colorData[2] - 35;          // outerBorder blue
              colorData[6] = colorData[0] + 30;          // innerBorder red
              colorData[7] = colorData[1] + 30;          // innerBorder green
              colorData[8] = colorData[2] + 20;          // innerBorder blue
              /* Make sure the new color data is not out of bounds: */
              for (int i = 3; i < colorData.length; i++)
                   if (colorData[i] > 255)
                        colorData[i] = 255;
                   else if (colorData[i] < 0)
                        colorData[i] = 0;
              borders[0] = new Color(colorData[3], colorData[4], colorData[5]);
              borders[1] = new Color(colorData[6], colorData[7], colorData[8]);
              return borders;
         /* public Color getBaseColor()
          *   Returns the baseColor of this object.
         public Color getBaseColor()
              return baseColor;
         /* public Color getOuterColor()
          *   Returns the outerBorderColor of this object.
         public Color getOuterColor()
              return outerBorderColor;
         /* public Color getInnerColor()
          *   Returns the innerBorderColor of this object.
         public Color getInnerColor()
              return innerBorderColor;
         /* public boolean getFullTransEnabled()
          *   Returns whether or not this object will render
          *   with all of its transparency effects.
         public boolean getFullTransEnabled()
              return fullTransparencyEnabled;
         /* protected void paintComponent(Graphics g)
          *   Paints the component with the borders and colors
          *   that were set up in above methods.
         protected void paintComponent(Graphics g)
              Graphics2D g2d = (Graphics2D) g;
              AlphaComposite alphaComp;
              g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
              g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
              g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
                                            RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
              g2d.setColor(getBaseColor());
              /* Draw the main body of the component */
              if (getFullTransEnabled())
                   alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f);
                   g2d.setComposite(alphaComp);
              else
                   alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f);
                   g2d.setComposite(alphaComp);
              g2d.fillRect(cbw, cbw, super.getWidth() - 2 * cbw, super.getHeight() - 2 * cbw);
              alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f);
              g2d.setComposite(alphaComp);
              /* Draw the inner border: */
              g2d.setColor(getInnerColor());
              g2d.fillRect(obw, obw, ibw, super.getHeight() - obw * 2); // left border
              g2d.fillRect(obw, obw, super.getWidth() - obw, ibw); // top border
              g2d.fillRect(super.getWidth() - cbw, obw, ibw, super.getHeight() - obw * 2); // right border
              g2d.fillRect(obw, super.getHeight() - cbw, super.getWidth() - obw * 2, ibw); // bottom border
              /* Draw the outer border: */
              g2d.setColor(getOuterColor());
              g2d.fillRect(0, 0, obw, super.getHeight()); // left border
              g2d.fillRect(0, 0, super.getWidth() + obw, obw); // top border
              g2d.fillRect(super.getWidth() - obw, 0, obw, super.getHeight()); // right border
              g2d.fillRect(0, super.getHeight() - obw, super.getWidth(), obw); // bottom border
              alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f);
              g2d.setComposite(alphaComp);
              g2d.dispose();
    }

    I added the main method to your TransparentContainer class ...
         public static void main(String[] args) {
              JFrame f = new JFrame("test transparent container");
              f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              TransparentContainer tc = new TransparentContainer(Color.RED, true);
              JLabel label = new JLabel("Hello, World!");
              tc.add(label);
              f.getContentPane().add(tc);
              f.setSize(800, 600);
              f.setVisible(true);
         }...using the code you posted the label was not shown. I modified your paintComponent(Graphics g) method and I did this (see the areas in bold):
         /* protected void paintComponent(Graphics g)
          *   Paints the component with the borders and colors
          *   that were set up in above methods.
         protected void paintComponent(Graphics g)
              // Call super so components added to this panel are visible
              super.paintComponent(g);
              Graphics2D g2d = (Graphics2D) g;
              AlphaComposite alphaComp;
              g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
              g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
              g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
                                            RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
              g2d.setColor(getBaseColor());
              /* Draw the main body of the component */
              if (getFullTransEnabled())
                   alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f);
                   g2d.setComposite(alphaComp);
              else
                   alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f);
                   g2d.setComposite(alphaComp);
              g2d.fillRect(cbw, cbw, super.getWidth() - 2 * cbw, super.getHeight() - 2 * cbw);
              alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f);
              g2d.setComposite(alphaComp);
              /* Draw the inner border: */
              g2d.setColor(getInnerColor());
              g2d.fillRect(obw, obw, ibw, super.getHeight() - obw * 2); // left border
              g2d.fillRect(obw, obw, super.getWidth() - obw, ibw); // top border
              g2d.fillRect(super.getWidth() - cbw, obw, ibw, super.getHeight() - obw * 2); // right border
              g2d.fillRect(obw, super.getHeight() - cbw, super.getWidth() - obw * 2, ibw); // bottom border
              /* Draw the outer border: */
              g2d.setColor(getOuterColor());
              g2d.fillRect(0, 0, obw, super.getHeight()); // left border
              g2d.fillRect(0, 0, super.getWidth() + obw, obw); // top border
              g2d.fillRect(super.getWidth() - obw, 0, obw, super.getHeight()); // right border
              g2d.fillRect(0, super.getHeight() - obw, super.getWidth(), obw); // bottom border
              alphaComp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f);
              g2d.setComposite(alphaComp);
              // Do not dispose the graphics
              // g2d.dispose();          
         }...seems to work fine now. Perhaps you should also add methods or additional constructors so the user can easily change the transparency level...and add some javadoc comments to your constructors ...at a first glance I did not know what fullTrans was
    public TransparentContainer(Color color, boolean fullTrans)good luck!!

  • Why do I get a colored shadow behind shadow and feather transparency areas when printing?

    Hello,
    I've been pulling my hair out over this and finally went to my printer to ask if they had insight as to why this is happening. I'll include his reply here but would like to hear your expert opinions too!
    When laying out a file in InDesign, I do a lot of overlapping, feather and some drop shadow and always get a colored shadow behind the transparency area when printing out from a pdf. These files are being designed for print, which is what I thought InDesign was created for - as an updated alternative to Quark and Pagemaker? Here is what the printer says:
    "Ive taken a look at the file in question and the issues this lady is experiencing can not be resolved in InDesign. What she needs to do is build the background image with color overlays all in Photoshop as a Layered PSD. Then flatten it and pull it in to InDesign as a Tiff. Then she can place her text over the top of it. She needs to use image masks on the color overlays - for the areas she does not what the color to violate.
    What it comes down to is these fancy design effects out of InDesign and Illustrator should never be used for printing. They can be used for web design. Reason is, they cause RIP problems. Things fall off the file and transparent areas go away just to name a few. This happens all the time."
    I would appreciate any other viewpoints here. Can I really NOT use the shadow and feather functions in InDesign for print? Are there any other ways to approach this problem other than what is being advised here. It is SO much easier to produce the entire file in InDesign.
    Here is a link to the pdf. If someone would like to see the original indd file, I can post it somewhere.
    http://displaysunlimitedinc.com/test/panel_3_text.pdf
    There is a 1 inch blur drop shadow on the black and white temple image; a 1 inch feather on the black and white screened back image behind the main text box; and no drop shadow or feather on the map at top right, yet I get a colored shadow behind all 3 of these areas when I export the indd file to pdf and print that out. The fact that I get a shadow behind the map puzzles me.
    Thank you very much in advance.

    Horgycat,
    The CMYK/RGB question is actually pretty complex, and depends to a great extent on how the final output is going to be produced.
    If the files are destined for a printing press, all RGB elements must be converted to CMYK prior to printing. You have the option of doing that before placing in ID, or during export to PDF, and there are pros and cons to both methods, but if you don't know until the last minute what the print conditions will be, the convert on export path is more flexible.
    Spot colors are a different matter. As far as I'm concerned, you should NEVER specify a spot color unless you are actually using spot ink on a press. A lot of inkjet and laser devices claim to be Pantone certified, but the reality is that even with expanded gamuts available using more than four inks, I'd estimate that better than half the Pantone solids are not reproducible as simulations that would satisfy me or my clients. The convert spot to process route should only be used, in my opinion, when you've designed a job properly to be printed using spot colors, and suddenly you have an output change or an added image that forces you to move to a process output. The last time I tried it, by the way, I had issues at the printer (the regular prepress guy was out of town, so I'm not sure what went wrong) and I ended up re-building the file with real process colors to get the transparency to work.
    But you mentioned that you are doing exhibition panels, which implies to me that they are probably NOT going on a press -- you need to do hundreds, or sometimes even thousands, of copies to make a press cost-effective compared to digital printing. I used to work in a large-format output bureau doing just this kind of work, and we used large inkjet plotters. In this case, mixed RGB and CMYK files are less of an issue since most plotters will handle either, and depending on if they have an internal or external RIP or none at all, you may actually get better color fidelity using RGB as CMYK colors may get converted in the RIP to the RGB values that the plotter understands, and then get converted back a second time to CMYK (CMYKOG or whatever ink combination is used) internally before the ink is sprayed. Only the print provider would be in a position to tell you the correct color space for the equipment.
    Which of course puts you at a bit of a disadvantage working with a client out of state who isn't supplying you with such necessary information as the correct output profiles for the job. It will be a miracle if the color is close.
    A final word about looking funky on screen. Just as many spot colors can't be well simulated in CMYK, many also cannot be displayed adequately on a monitor. The ONLY way to choose spot colors is with a swatch book, and that's what the press operator will be using to verify his work. Clients need to be educated about the differences in technology and the limitations of soft proofs.

  • Having a JPanel 'float' semi-transparently over another component

    I am a programmer of a java project for our company.
    Managemnt decided that when a certain event happens, we need to 'semi-disable' a certain text area (in a JScrollPane), and have a floating message with a progress bar on top of this text area, but be semi-transparent, so you can still read the text under it.
    (Basically, they want it to look like a html page with a floating, semi-transparent DIV, because that is how another group mocked it up).
    I am trying to implement this, but am running into problems.
    Here is what I have, below I'll tell you what is wrong with it.
         * The purpose of this class is to have a scroll pane that can have it's contents partially covered by another panel
         * while still being able to read both the original panel and the new covering content, and still being able to scroll
         *the content under the covering panel.
        public class JOverlayScrollPane extends JScrollPane{
            private JPanel overlay = null;
            private Insets overlayInsets = null;
            private java.awt.AlphaComposite blend = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.50f);
            private ComponentAdapter cl = null;
            public void setOverlay(JPanel pan, Insets inset){
                overlay = pan;
                overlayInsets = inset;
                if(cl != null){
                    cl = new ComponentAdapter(){
                        public void componentResized(ComponentEvent e){
                            resizeOverlay();
                resizeOverlay();
                repaint();
            public void paint(Graphics g){
                super.paint(g);
                if(g instanceof Graphics2D && overlay !=null){
                    Graphics2D g2 = (Graphics2D)g;
    //                g2.setComposite(blend);
                    //overlay.paint(g2);
                    paintStuff(g,overlay);
            private void resizeOverlay(){
                if(overlay != null){
                    Dimension size = getSize();
                    int x = 0;
                    int y = 0;
                    if(overlayInsets !=null){
                        x = overlayInsets.left;
                        y = overlayInsets.top;
                        size.width = size.width - overlayInsets.left - overlayInsets.right;
                        size.height = size.height - overlayInsets.top - overlayInsets.bottom;
                    overlay.reshape(x,y, size.width, size.height);
                    overlay.doLayout();
                    overlay.validate();
            private void paintStuff(Graphics g,Component c){
                if(c != null){
                    c.paint(g);
                    if(c instanceof Container){
                        Container cont = (Container)c;
                        for(int i=0;i<cont.getComponentCount();i++){
                            Component cc = cont.getComponent(i);
                            paintStuff(g,cc);
        }//end of overlay scroll pane(I am having problems, so for now, the alpha blend is commented out).
    The first version didn't have the paintStuff() method (it just called paint). This just drew a big grey box, now of the sub-components of the passed in JPanel were drawing. I added the do layout and validate calls, without success.
    Then I added the paintStuff call, and all the subcomponents now, draw, but they all draw at 0,0.
    Questions
    1. Is the the correct approach to do this, or sould I be playing with the glass pane or some other approach?
    2. It seems that the overlay panel isn't being layed out / doens't paint it's children correctly. Is this because it isn't really part of the layout (i.e. it has no parent / is never added to a container) or am I just missing a step in 'faking' adding it to a layout?
    3. I'm sure I could just override paint and paint my own stuff (hand draw the text and a progress bar), but I would really like to put everything on one JPanel as what we want to display my be different in the future. I know that I manually ahve to call repaint on this scrollpane if one of the components on the overlay JPanel change in appearence (the progress bar especailly), and that they won't get events (I don't care about this as they are all non-interactive for now). Is this a viable approach, or is there a better way to do this?
    Thanks

    Wow, good answer.
    I never concidered using a root pane other than as it is used in JFrame.
    Very cool answer.
    Here is my origional code modifed with JN_'s idea, which cleaned up a repaint issue I was having.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TransparentPanel extends JFrame implements ActionListener
        ProgressPanel progressPanel;
        int progressCount;
        public TransparentPanel()
            super( "TransparentPanel Test");
            setDefaultCloseOperation( EXIT_ON_CLOSE );
            JPanel panel = new JPanel( new BorderLayout() );
            JTextArea area = new JTextArea( 20, 40 );
            JRootPane pane = new JRootPane();
            pane.setContentPane( new JScrollPane( area ) );
            panel.add( pane, BorderLayout.CENTER );
            //panel.add( new JScrollPane( area ), BorderLayout.CENTER );
            progressPanel = new ProgressPanel();
            pane.setGlassPane( progressPanel );
            JPanel buttonPanel = new JPanel( new FlowLayout());
            JButton button = new JButton( "Show" );
            button.setActionCommand("SHOW");
            button.addActionListener( this );
            buttonPanel.add( button );
            button = new JButton( "Hide" );
            button.setActionCommand("HIDE");
            button.addActionListener( this );
            buttonPanel.add( button );
            panel.add( buttonPanel, BorderLayout.SOUTH);
            setContentPane( panel );
            pack();
            setLocationRelativeTo( null );
            setVisible( true );
        public static void main( String[] args )
            try
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch( Exception e )
                e.printStackTrace();
            new TransparentPanel();
        public class ProgressPanel extends JPanel
            Color bg = new Color( 225, 221, 221, 100 );
            Color fg = new Color( 170, 234, 202, 100 );
            int progress;
                   setOpaque( false );
            public void setProgress( int n )
                 setVisible( n > 0 && n <= 100 );
                progress = n;
                repaint();
            public void paint( Graphics g )
                if( isVisible() )
                    Rectangle bounds = getBounds();
                    g.setColor( bg );
                    g.fillRect( bounds.x, bounds.y, bounds.width, bounds.height );
                    g.setColor(  fg );
                    int width = (int)(((double)progress/100)*bounds.width);
                    int height = (int) (((double)bounds.height)*.1);
                    int y = (int) (((double)bounds.height)*.4);
                    g.fillRect( bounds.x,y,width,height);
         * Invoked when an action occurs.
        public void actionPerformed(ActionEvent e)
            String cmd = e.getActionCommand();
            if(cmd.equals( "SHOW" ) )
                progressCount+= 10;
                if( progressCount > 100 )
                    progressCount = -1;
            else if( cmd.equals("HIDE" ) )
                progressCount = -1;
            progressPanel.setProgress( progressCount );
    }

  • Semi-transparent block, pure black and rich black problems

    Hi!
    I'm new to inDesign, and I'm currently designing a book cover, for which I need some special effects. I'll try to explain as best as I can.
    The background is rich black, on top of it I have a text in white (all over it). I applied a block with 80% opacity, in rich black color. I cut out some shapes in it. The point was to have the text in dark gray all over the book cover, but in white in the places where I have the shapes.
    Everything is working exactly like I want, but a friend of mine told me if I apply rich black over white, I'll get a kind of magenta gray, so I have to apply pure 100 K to avoid that and get the dark gray I want. I tried that, and of course, applying some pure black block on top of my rich black cover gives all the cover a "grayish black" look. How can I work around that? I tried setting my semi-transparent block to "darken", but it didn't change anything.
    I put the links to the pdf, I hope that's ok.
    That's the one with rich black: https://dl.dropboxusercontent.com/u/68049919/coverlayout_print_richblack.pdf
    and that's how it looks with the pure black: https://dl.dropboxusercontent.com/u/68049919/coverlayout_print.pdf
    Thanks a lot!

    There's no need to use transparency to create your background text color—just make a text frame filled with the rich black  then select the type and fill it with an 80% tint of the rich black swatch or any other gray mix. Like this:
    The text frame selected with its fill showing in the Colors panel:
    Here the text is selected and the Colors panel shows the text fill as an 80% tint of the rich black. There's no transparency in this case.
    In general it's bad practice to use transparency when you can get the same effect with color fills.
    Also if you are worried about the neutrality of the gray check with your printer on whether the gray text should be 4-color (your 80% tint) or straight black (95% black).
    The accuracy of the InDesign softproof depends on an accurate monitor profile and the assigned CMYK profile (Edit>Assign Profiles...). The assigned CMYK profile affects the preview including the profiled gray balance. For example the default SWOP CMYK profile previews your 4-color dark gray bluer and as a lighter value than US Sheetfed.
    The preview of your 85% rich black mix with different CMYK asignments

  • Semi-transparent lines?

    Hi,
    I’m trying to develop an extended cross hairs cursor. However the lines are rendered as semi transparent although the opacity is set to 1.0. Following code is for testing.
    What’s wrong? Can somebody help me?
    Thx!
    @Override
    public void start(Stage stage) throws Exception {
            StackPane root = new StackPane();
            root.setStyle("-fx-background-color:black;");
            Scene scene = new Scene(root, 300, 300);
            stage.setScene(scene);
            stage.setTitle("Cross Hairs Test");
            final Line hLine = new Line();
            hLine.setStroke(Color.WHITE);
            hLine.setStartX(0);
            hLine.setEndX(300);
            hLine.setOpacity(1.0);
            final Line vLine = new Line();
            vLine.setStroke(Color.WHITE);
            vLine.setStartY(0);
            vLine.setEndY(300);
            vLine.setOpacity(1.0);
            final double mouseX = 150;
            final double mouseY = 150;
            Rectangle rect = new Rectangle(300, 300);
            rect.setOpacity(0);
            rect.setCursor(Cursor.NONE);
            rect.setOnMouseMoved(new EventHandler<MouseEvent>() {
              @Override
              public void handle(MouseEvent me) {
                   hLine.setTranslateY(me.getY() - mouseY);
                   vLine.setTranslateX(me.getX() - mouseX);
            root.getChildren().addAll(hLine, vLine, rect);
            stage.show();
    }

    This is because the coordinates you specify are not referring to concrete pixels but can also be in between the pixels (in which case they will be anti-aliased). The center of the top left pixel is actually (0.5, 0.5). The top left of the top left pixel is (0, 0).
    See this javadoc: http://docs.oracle.com/javafx/2.0/api/index.html?overview-summary.html and read the part of the interaction with the coordinate system.
    Anyway, a quick fix is to add 0.5 to coordinates:
    @Override
    public void handle(MouseEvent me) {
      hLine.setTranslateY(me.getY() - mouseY + 0.5);
      vLine.setTranslateX(me.getX() - mouseX + 0.5);
    }

Maybe you are looking for