Getting a semi-transparent graphic onto a spot plate in InDesign CS6

I'm struggling to get elements of a design onto the fifth colour plate in my InDesign file. Example is shown below. I have made a number of rough-edged strips that retain an element of semi-transparency along their edges (so that the background shows through slightly and gives a brushed/painted on effect). The client needs these elements to be on a fifth plate, Pantone 1385.
I have tried making the graphic as a greyscale psd and as a greyscale tiff with transparency included, but I can't seem to select within InDesign using the content tool and making it on the fifth plate in my ID palette.
Have done it as a CMYK psd for time being on example below just to allow me to show the client as a visual.
Can anyone help me? I have also (briefly) explored channels in Photoshop as well but can't make and headway there too. Is there a simple solution?
Many thanks for any advice.

Thanks for reply, but I think this loses me all transparency?
Make your grayscale file a transparent Monotone like this:
In ID fill the background of the image frame with black:

Similar Messages

  • Photoshop images with spot channels in Indesign CS6 (layout question)

    I've got an Indesign CS6 layout that will have a spot varnish when it goes to press. Right now I've got a layout with psd files that have spot channels in them that will be used for the spot varnish.
    My question is, in Indesign when I'm laying this out should I have one layer with all the psd artwork (with no spot channels) and then a layer on top of that with the psd files with the psd layers turned off with the spot channel showing? I want to make this easy to print in the office so by doing it this way I could just turn the spot layer off and print.
    Will this work for the printer?
    layer 1 psd files with no spot channels
    layer 2 psd files with photoshop layers turned off with the spot channel showing

    Besides the obvious extra work of tracking 2 images, there would be potential problems if the images needs to be scaled and moved, and you would have to assume people downstream would know what's going on—should the layer be on or off?
    I would double check with the current printer—they should know the only way to view a spot is via Sep or Output preview by turning CMYK off—magenta could just as easily be process as  spot.
    Take a closer look at the Alias method. Here it is with your magenta defined SPOT VARNISH.
    With SPOT VARNISH set as No Alias in Ink Manager and with Overprint turned on:
    And with an additional spot color defined as white named CLEAR VARNISH. When you need to print in house alias SPOT VARNISH to CLEAR VARNISH and check Simulate Overprint in the Print dialog. You can get to Ink Manger via the Print>Output dialog or Swatches panel:
    All you have to do is delete the CLEAR VARNISH before sending the job to the printer or exporting

  • I want to get CC out of my computer, and go back to Indesign CS6 and convert my files to IDML

    I have never liked CC on my computer.  It does very weird things, freezes sometimes, and I have converted back to CS6 and updated to latest version, which of course is way behind what CC is at (v 10 something now?).  However, when I open my newly saved CC file as an Indesign IDML file, it loses the file name I gave it, and reopens it as "untitled" -- and this is making me crazy.  What is going on???

    Normal behavior. IDML files always open as untitled.

  • How do I ensure that a semi-transparent background stays that way when converting a pptx file to PDF

    I can't seem to get a semi-transparent background image when converting to PDF file.  Every time I try it - the image converts to a full color - zero transparency background, muting out the text on the page.
    Please help.
    Thank you.

    Hi LeighAnnie,
    If you're running Windows, you could try setting up the CreatePDF Desktop printer. 
    -David

  • Transparent Graphics Image

    Hey all,
    I have a couple questions regarding using a JPanel's Graphics object to get a an Image object and use that object as a "face" of 3D cube in Java3D.
    Right now, thanks to the help of many of you guys, I have gotten what I want. That is a cube that has painted on it the Graphics stuff from some JPanel. Now I want more.
    Is there a way to set the background to transparent instead of a certain color. I want to do this because I have two parallel planes that have something painted on them. I want to look straight onto the top one, and where there are "gaps" (where you would usually see the background color), you will instead see the plane behind it.
    Another thing is that I have mouse stuff implemented so you can move and rotate the 3D figure. If I flip around this 3D cube thing, of course I can't see the back (its just black). Is there anyway to have the back just show the front.
    What I am going for here is like drawing the Graphics stuff on a clear glass. Where there is nothing drawn, you can see through, and from the back, you can see through the glass to see the contents (backwards of course).
    Any ideas?
    Let me know if my descriptions are too vague.
    Thanks,
    armand

    Ok here is when I'm actually drawing the panel painting on the plane (i do the same for each plane):
    //... define points for plane
    Appearance appear = new Appearance();
    TextureLoader loader = new TextureLoader(bimage);
    ImageComponent2D image = loader.getImage();
    Material m = new Material();
    m.setDiffuseColor(0.1f,0.9f,0.9f);
    m.setSpecularColor(1.0f,0.0f,0.0f);
    m.setAmbientColor(0.9f,0.9f,0.9f);
    m.setShininess(25.0f);
    appear.setMaterial(m);
    // can't use parameterless constuctor
    Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA,
    image.getWidth(), image.getHeight());
    texture.setImage(0, image);
    appear.setTexture(texture);
    TransparencyAttributes ta =
         new TransparencyAttributes(TransparencyAttributes.NICEST,0.7F);
    appear.setTransparencyAttributes(ta);
    return new Shape3D(plane, appear);
    For the JPanel paintings, I tried to set the background color to transparent- the alpha value. While the JPanel's background is semi-transparent, I think when I capture it, it does not retain the semi-transparency. It just grabs whats on the screen- like if I wanted to print (I use the same idea for printing).
    I know my planes are transparent, because if I comment out the line
    appear.setTexture(texture);
    I get two transparent planes- I can see through them. As soon as I add the above line- which actually paints the JPanel painting on the transparent planes- I loose transparency.
    So I figure its something I need to do with the texture object, but I cant seem to get anywhere. Any help?
    thanks,
    armandfcdx

  • How can I capture a semi transparent window?

    Hello all
    I am trying to grab an image of a semi transparent window into a bitmap. I have tried using both CopyFromScreen and BitBlt using the window handle but in both cases all I get is the image from behind the window I want to catch, it's like the semi transparent
    window is completely invisible to both capture methods. Is there any way I can capture the window I want?
    Thanks
    Rich

    Here is an example. You can try it in a new form project with 1 Button and 1 PictureBox added to the form. As i said, it is just an example so, when it is run the form will be partialy transparent. Click the button and it will capture the whole screen including
    your transparent form. Then it will set the forms opacity back to 1.0 so you can see that the transparent form was captured in the image.
     You will need to set it up to be used in a practical way. This is just a quick test example.
    Imports System.Runtime.InteropServices
    Public Class Form1
    Private Const CAPTUREBLT As Integer = &H40000000
    Private Const SRCCOPY As Integer = &HCC0020
    <DllImport("gdi32.dll", EntryPoint:="BitBlt")> _
    Private Shared Function BitBlt(ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function
    <DllImport("user32.dll", EntryPoint:="GetDC")> Private Shared Function GetDC(ByVal hWnd As System.IntPtr) As System.IntPtr
    End Function
    <DllImport("user32.dll", EntryPoint:="ReleaseDC")> Private Shared Function ReleaseDC(ByVal hWnd As System.IntPtr, ByVal hDC As System.IntPtr) As Integer
    End Function
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'set this form so it is partialy transparen. Just to show it was captured for this example
    Me.Opacity = 0.5
    PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'if the picturebox has an Image the Dispose it first
    If PictureBox1.Image IsNot Nothing Then PictureBox1.Image.Dispose()
    'define the rectangle area of the screen to capture (whole screen in this case)
    Dim CaptureRectangle As Rectangle = Screen.PrimaryScreen.Bounds
    'Assign the new image captured from the screen to the picturebox image
    PictureBox1.Image = CaptureScreenImage(CaptureRectangle)
    'just so you can see the image better set the form`s opacity back to 1.0
    Me.Opacity = 1.0
    End Sub
    Private Function CaptureScreenImage(ByVal rect As Rectangle) As Bitmap
    Dim scrnHdc As IntPtr = GetDC(IntPtr.Zero)
    Dim bmp As New Bitmap(rect.Width, rect.Height)
    Using grx As Graphics = Graphics.FromImage(bmp)
    Dim grxHdc As IntPtr = grx.GetHdc()
    BitBlt(grxHdc, 0, 0, rect.Width, rect.Height, scrnHdc, rect.X, rect.Y, SRCCOPY Or CAPTUREBLT)
    grx.ReleaseHdc(grxHdc)
    ReleaseDC(IntPtr.Zero, scrnHdc)
    End Using
    Return bmp
    End Function
    End Class
    If you say it can`t be done then i`ll try it

  • 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 );
    }

  • Creating semi-transparency without PNG files

    Hi I have designed a logo for a friend and he needs to upload it onto a companies web site. They have said that it must be either Jpeg or Gif. However, since there is some semi-transparency in my logo a Gif file wont allow this and a Jpeg wont create any transparency. They wont allow PNGs. I have tried to find out what colour the website background will be so I can simply put the logo in a box of the same colour but apparently he is not able to find out this info.
    Is there any other way of getting around this?

    Can you change the logo so the gradient goes to a solid color instead of transparency?
    The very use of gradients at all is relatively new to the world of logo design. When UPS redesigned their logo several years ago there was a huge uproar in the community of the use of gradients ( see: http://www.dinesh.com/images/stories/logo/worldfamouslogos/ups_logo.jpg ).
    I don't think I've ever seen a logo that uses alpha transparency though, due to the exact problem you're having.
    Look at some of the samples on this site, perhaps it'll spark a creative idea that'll help you fix the problem:
    http://logopond.com/gallery/

  • Is there a way to create a semi-transparency with Java?

    I would like to be able to create a semi transparent form and I was does anyone know how to do this?

    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class CompositeTest extends JPanel {
        private BufferedImage backImage, frontImage;
        private float alpha = 1;
        public CompositeTest() throws IOException {
            backImage = ImageIO.read(new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg"));
            frontImage = ImageIO.read(new URL("http://today.java.net/jag/Image54-small.jpeg"));
        public Dimension getPreferredSize() {
            return new Dimension(backImage.getWidth(), backImage.getHeight());
        public void setAlpha(float alpha) {
            this.alpha = alpha;
            repaint();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            int x = (getWidth() - backImage.getWidth())/2;
            int y = (getHeight()- backImage.getHeight())/2;
            g2.drawRenderedImage(backImage, AffineTransform.getTranslateInstance(x, y));
            Composite old = g2.getComposite();
            g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
            x = (getWidth() - frontImage.getWidth())/2;
            y = (getHeight()- frontImage.getHeight())/2;
            g2.drawRenderedImage(frontImage, AffineTransform.getTranslateInstance(x, y));
            g2.setComposite(old);
        public static void main(String[] args) throws IOException {
            final CompositeTest app = new CompositeTest();
            JSlider slider = new JSlider();
            slider.addChangeListener(new ChangeListener(){
                public void stateChanged(ChangeEvent e) {
                    JSlider source = (JSlider) e.getSource();
                    app.setAlpha(source.getValue()/100f);
            slider.setValue(100);
            JFrame f = new JFrame("CompositeTest");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container cp = f.getContentPane();
            cp.add(app);
            cp.add(slider, BorderLayout.SOUTH);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • 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!!

  • How to apply a semi-transparent background to a text box

    Hi Framers,
    The cover of my doc has a full-page .png file on a master page. I want to add the title of the manual on the body page of the cover in a text box. No problem. However, I want to apply a semi-transparent effect to the background of the text box, so the graphic behind it shows in a muted way.
    I'm sure this has to do with some combination of the Tint, Fill, and Overprint settings but none of my experiments have produced anything close to the desired effect.
    I did RTFM and also searched the Help and the forum. I truly hope I didn't overlook the answer---but if I did, it wasn't for lack of trying!
    As always, your expertise is very much appreciated.
    TIA,
    Gay

    Wow, I wish I had Photoshop! I use a less sophisticated image editor, which has always served quite adequately and since it supports layers, I'll try to figure out how to do what you're suggesting.
    (I did try a "None" fill and the bottom image does show up, but I wanted it a bit muted, as would happen with perhaps a "half transparency" and that is apparently what I can't achieve in FM.)
    If I understand correctly, I need to edit the imported graphic to make a portion of it appear semi-transparent, and then when I bring it back into FM and put my text box on top of it, it will appear the same as if I had been able to put a partial transparency in the fill of the text box...
    I really, really, really hate it when I find myself thinking "Word could do this easily, why can't Frame?"
    Thanks for your helpful suggestions, guys, you're great. As always!
    Gay

  • 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

  • Scrolling semi-transparent panels

    I have a parent panel that paints a custom background. Within that panel, I embed another panel held by a JScrollPane. My intent is to have the custom background show through on the panel that is being scrolled.
    To accomplish this, I set both the scrollpane and the viewport to non-opaque and then I set the panel held by the scrollpane to non-opaque as well.
    When I run the program everything works fine and the panel can be scrolled and displayes the background image just as I want it.
    Next, I want to set the panel in the scrollpane to be semi-transparent. I set the panel to opaque and give it a semi-transparent background color(ie alpha value or .5). This gives me a see-through effect and when I run the program it initially looks good. However, when I scroll the panel, the refresh is not handled correctly. The problem appears to be that the paint method of the parent panel is not being called.
    I think the scrollbar code incorrectly assumes that since the embedded panel is defined as opaque that the parent panels do not need to be painted. However, this assumption is only valid if the background color of the embedded panel has an alpha value of 1.0
    Does anyone have a workaround for scrolling semi-transparent panels?

    On second thought, that's going to cause a stack overflow. You are going to need a flag to not call it. Something like so:public void paint(Graphics g) {
        if (someflag) {
            someflag=false;
            bgPanel.paint(bgPanel.getGraphics());
            someflag=true;
        // do my painting stuff ... super.paint(g); ???
    }Just a thought, I haven't tested it.

  • Subtitles with semi-transparent background rectangle

    Hello -
    Is it possible to create a semi-transparent background that helps make subtitles more readable? I need to do this using the DVD SP interface or make a modification to a .stl file.
    Either method will work.
    I am using DVD SP 4.2.0

    It is possible only with graphic files STL variation.

  • Semi-transparent JToolBar = strange behaviour?

    I need to have semi-transparent toolbar in the application I am making. I am using toolbar.setBackground(new Color(0, 0, 0, 50)); to do so.
    At start the icon looks like this:
    [Screenshot1|http://i29.tinypic.com/j66cky.jpg]
    After a few mouse transition, the transparent part of png icon becomes totally black:
    [Screenshot2|http://i26.tinypic.com/dmwjo9.jpg]
    I�ve tried using JButton (with ActionListener), instead of JLabel component, but the behaviour remains the same.
    Here�s the test code:
    package toolbartest;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainFrame extends JFrame {
        private MainFrame(String title) {
            setSize(new Dimension(800, 600));
            setTitle(title);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setLocationRelativeTo(null);
            JToolBar toolbar = new JToolBar();
            toolbar.setBackground(new Color(0, 0, 0, 50)); // <-- when remove this
            toolbar.add(new ToolBarButton());              //     line then is OK
            add(toolbar, BorderLayout.NORTH);
        public static void main(String[] args) {
            new MainFrame("ToolBar Test").setVisible(true);
    class ToolBarButton extends JLabel {
        public ToolBarButton() {
            super(new ImageIcon(MainFrame.class.getResource("exit.png"))); // <-- transparent png
            setBorder(BorderFactory.createLineBorder(Color.BLACK));        //     icon 32px x 32px
            addMouseListener(new MouseAdapter() {
                @Override
                public void mouseEntered(MouseEvent e) {
                    setBorder(BorderFactory.createLineBorder(Color.RED));
                @Override
                public void mouseExited(MouseEvent e) {
                    setBorder(BorderFactory.createLineBorder(Color.BLACK));
                @Override
                public void mouseClicked(MouseEvent e) {
                    System.exit(0);
    }

    Thanks camickr, very helpful explanation.
    Here's (good) working code:
    package toolbartest;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainFrame extends JFrame {
        private MainFrame() {
            setSize(800, 600);
            setTitle("ToolBar Test");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setLocationRelativeTo(null);
            JToolBar toolbar = new JToolBar() {
                @Override //<-- Paint background
                protected void paintComponent(Graphics g) {
                    g.setColor(getBackground());
                    g.fillRect(0, 0, getSize().width, getSize().height);
                    super.paintComponent(g);
            toolbar.setOpaque(false);   //<-- Toolbar is non-opaque
            toolbar.setBackground(new Color(0, 0, 0, 50)); //<-- Background color
            toolbar.add(new ToolBarButton());              //that has an alpha value
            add(toolbar, BorderLayout.NORTH);
            setVisible(true);
        public static void main(String[] args) {
            new MainFrame();
    class ToolBarButton extends JLabel {
        public ToolBarButton() {
            super(new ImageIcon(MainFrame.class.getResource("exit.png"))); // <-- transparent png
            setBorder(BorderFactory.createLineBorder(Color.BLACK));        //     icon 32px x 32px
            addMouseListener(new MouseAdapter() {
                @Override
                public void mouseEntered(MouseEvent e) {
                    setBorder(BorderFactory.createLineBorder(Color.RED));
                @Override
                public void mouseExited(MouseEvent e) {
                    setBorder(BorderFactory.createLineBorder(Color.BLACK));
                @Override
                public void mouseClicked(MouseEvent e) {
                    System.exit(0);
        }

Maybe you are looking for