Graphics object with transparent background

Ive been trying to create an image using a graphics object, which i want to have a transparent background. I have been researching on the net and have come up with something like this, but its not really getting the job done. Im still getting an image with a black background. The image will always be 200 by 100 pixels.
public void drawGraph(Graphics2D g,int a,int b, int d)
         Composite oldComp = g.getComposite();
         Composite alphaComp = AlphaComposite.getInstance( AlphaComposite.CLEAR);
         g.setComposite(alphaComp);
         g.fillRect(0,0,200,100);
         g.setComposite(oldComp);
<<OTHER STUFF DRAWN HERE>>
      }Any tips would be greatly appreciated thanks.

Create a BufferedImage like this:
int width = 200;
int height = 200;
BufferedImage yourImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

Similar Messages

  • How to create a live trace object with transparent background?

    Hi, I am trying to create a live trace object of my logo in ai. The logo is coming from photoshop on a transperent background, and it is all black. What I want to do is to bring it into ai and make it an object for obvious reasons. The problem I have had is that when I live trace it, the live trace leaves a white background which then overlaps with other objects in my ai file. Is there a way to live trace while preserving the transparent area or possibly better, to not include white space in the live trace? Thanks in advance!

    Yep open the properties for live trace (Object>Live Trace>Tracing options). You will find a checkbox for ignore white.

  • Help export the graphic with transparent background and not braking the quality

    hi I'd like some help please if its possible.
    I've created a monitor graphic in Fireworks that looks like iMac and I would like to export it with transparent background.
    the jpeg format looks great with no damage to the graphic at all but I can't have transparent background, although I changed the canvas fill to none. the png-8 format can apply transparent background, but damages the graphic.
    Here are the previews
    1st - the png-8 format
    2nd - thejpeg format
    A ny ideas on how I can export the graphic with transparent background and not braking the quality??

    Fireworks questions are best answered at this link:
    <http://forums.adobe.com/community/fireworks/fireworks_general>
    Good luck.

  • HT4641 Importing graphics with with transparent backgrounds such as .psd or .eps

    I want to use this for an art project for my sons class. Can I import .psd files with transparent backgrounds as per Word, to retain the clear cut shape/opacity of background. Or can I import .eps illustrator files with transparent backgrounds? Thanks.

    If you need transparency - as I stated - you need to convert the image to GIF. PSD is a layered graphic workspace file specifically for PhotoShop; EPS can be read by more applications, but is still basically a graphic print format. It might serve your customer needs, but wouldn't be the format I would recommend for general distribution. Typically you wouldn't embed EPS in another file, it would be the container for the print ready document (and the concern for transparency would be somewhat moot).
    However, I'm not familiar with the intimate details of your project or customer needs, so take that for what its worth.

  • Save jpg or tiff with transparent background

    How do you save a jpg image of something (ART) created with a transparent background so that it can be printed on fabric?

    AppleWorks doesn't handle transparency well, even using formats such as .gif or .png saved with transparent backgrounds in another application. However, a few years ago I accidentally discovered that if an object is flipped or rotated in AppleWorks, the background will become transparent. The object doesn't even have to be .gif or .png & have transparency.
    Once I discovered this, I used GraphicConverter to flip an image horizontally & save it as a PICT. Then I insert the object in my AppleWorks document & flip it back. I use PICT because it is the only graphic format that will retain the native resolution. All other graphic formats are changed to 72 dpi by AppleWorks.
    Unfortunately, the last few times I tried this, it no longer worked. For myself, I use Pages for this kind of work now. I handles transparency very well.

  • How do I transfer a .psd file to illustrator that can then be placed in Muse as a .svg with transparent background?

    I just wrote all this up in another thread.  I did not realize at the time that the last post was in 2014, so I'm giving it a go here.
    I am currently trying to create an .svg using Photoshop .psd file (with layers in tact).  I'm new to these products so it may be obvious to others that the above intention was to eventually place the .svg in some sort of website creation software such as Muse.  Which is precisely what I am attempting. However, I am getting a white background once I place or copy and paste into Muse.  My starting .psd has a transparent background without any hidden layers causing this problem.  To test this I placed the .psd file into Muse and it still has a transparent background.  However when opening or placing this file into illustrator, it picks up a white background. If I do exactly as described above, I still get the same result.  So far I have tried:
    1) Simple copy and paste from Photoshop .svg to illustrator to Muse.  Result - white background.
    2) Placing the .psd in illustrator, then placing the .svg file in muse.  Result - white background.
    4) I have also tried the every combination of 1 and 2. - Result - white background.
    3) I have now created a path in Photoshop from the text layer to yet again attempt the above methods.  Result - white background.
    I'm including an image of the object I am trying to place with transparent background, but I have both a flattened rasterized version, a version complete with layers and a third (.svg) with the corresponding objects.  I am completely new to Illustrator as of today so any help would be greatly appreciated.  Thanks.
    Link to .psd file "Welcome text"

    I was having some difficulties getting the correct dimensions of one of my objects, I eventually solved this problem without using svg.  It was pretty simple when I stopped trying to over complicate things.  I just linked the object to a near by object in photoshop, merged and placed it all as one.  It looks great now.  Thanks for your reply.  You are correct, SVG was not the answer.

  • Want to create an oval vignette in photoshop elements 10 with transparent background for printing w

    I am fairly new to PSE and I want to create an oval vignette in Photoshop Elements 10 with transparent background for printing on white paper using MS Publisher. Using the white background on inverse selection makes a slight line impression and either it should have a defined "frame" or nothing.
    Appreciate any guidance.

    Try with the Elliptical marquee tool:
    On the tool's option bar set feather 25-40 px (experiment)
    Drag out the Ellipse to embrace the object
    Go to Layer>new>layer via copy, or CTRL+J
    Your selection should fade out as a vignette and be surrounded by transparency
    Save this layer via File>save for web, select PNG-24, and tick "Transparency"

  • Images with transparent backgrounds in MDM

    I've got several images in MDM with transparent backgrounds, yet when i look at these in image manager (or thumbnails in data manager) they look terrible. The transparency is black for example, among other issues. These images are all okay in photoshop, they have been saved as .png and imported through the data manager.
    Has this import ruined these image files on the way in? When my search engines etc extract the images, what of the transparencies?

    Hi Adam,
    MDM makes use of Internet Explorer quite frequently. I can imagine that this engine is also used to display images in MDM. However, Internet Explorer in version 6 does not support transparency in PNG images. That is why the black background occurs.
    Since your images after upload are only saved in a binary object in the database, you should not encounter any data loss when using the same images. If you need to create variants, I would consider using Photoshop for the creation of those.
    I hope that helps you further.
    Best regards
    Christian

  • Printing Images with Transparent Background

    Sorry if this question has already been asked, but I couldn't find anything similar to it in a search through the archives.
    I have a couple of images with transparent backgrounds in a document, much like the shells and the blue flowers in the "Classic Brochure" template in Pages 2.0.1. These images show up perfect on the screen, and when printed as .pdf files, but when I print to either an hp color laserjet 4600 or an hp laserjet 1320, the images show up with a clear box around them; the colors under the box (where it should be transparent) are faded and slightly blurred. This happens both with my document, and the unaltered "Classic Brochure" template. I've tried moving various objects backwards and forwards, but it doen't seem to have any effect. It even happens with one of the text boxes I have in the document.
    Another odd thing is that the printed "box" isn't the same size as the box that appears when you click on the object in the document. It's a bit bigger. I've seen other posts about problems with hp printers, but I'm not sure it's related. Any insight would be appreciated.
    MAF
    iMac Intel Core Duo   Mac OS X (10.4.7)  

    http://indesignsecrets.com/eliminating-ydb-yucky-discolored-box-syndrome.php
    Bob

  • Framing image with transparent background png frame

    hi,
    i'm trying to find a way to frame images with transparent background png frames...
    what i'm doing now is
    1-drawing my image on a panel
    2-creating a 2nd image using the frame's filename, stretching this 'frame-image' to a size slighlty larger than that of my main image and drawing the 'frame-image'
    the problems with this method are:
    1-depending on the width of the frame, the frame sometimes hides parts of the image (thick frame), and sometimes there is a gap between the frame and the image (thin frame).
    2-if the image file containing the frame is larger than the frame (Ex: The image is 300x300, the frame is centered in this image and is 200x200; as opposed to the image is 200x200 and the frame takes up all the space), when i position the 'frame-image' near the top left corner of the image i want to frame, the frame appears at the wrong place (shifted down and to the right). This is due to the fact that i'm placing the top corner of the created 'frame-image' and not the frame, who is not in the top corner of my 'frame-image'.
    Is there a way to do what i'm trying to do???
    My ideas (which i don't know how to achieve are)
    1-To 'analyse' my transparent background png file and
         1-only keep the frame,
         2-calculate the frame's thickness
    OR
    2-Let java do the analyzing for me and tell it to frame my image with the frame in the png file
    please feel free to ask for more explanations if my description/question is confusing,
    thanks.

    Have you looked into the Border interface? If what you really want to do
    is put a custom border on a component, you may be able to do it this way.
    Anyway, here is some code that stacks and centres 2 images. It's not hard to do.
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import javax.imageio.*;
    import javax.swing.*;
    public class Example extends JComponent {
        private BufferedImage backgroundImage;
        private BufferedImage foregroundImage;
        public Example(BufferedImage backgroundImage, BufferedImage foregroundImage) {
            this.backgroundImage = backgroundImage;
            this.foregroundImage = foregroundImage;
        public Dimension getPreferredSize() {
            int w = backgroundImage.getWidth();
            int h = backgroundImage.getHeight();
            return new Dimension(w, h); //assuming this is bigger
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            int w = getWidth();
            int h = getHeight();
            //paint both, centred
            int x0 = (w-backgroundImage.getWidth())/2, y0 = (h-backgroundImage.getHeight())/2;
            g.drawImage(backgroundImage, x0, y0, null);
            int x1 = (w-foregroundImage.getWidth())/2, y1 = (h-foregroundImage.getHeight())/2;
            g.drawImage(foregroundImage, x1, y1, null);
        public static void main(String[] args) throws IOException {
            URL url1 = new URL("http://weblogs.java.net/jag/Image54-large.jpeg");
            URL url2 = new URL("http://weblogs.java.net/jag/DukeSaltimbanqueSmall.jpeg");
            JComponent comp = new Example(ImageIO.read(url1), ImageIO.read(url2));
            final JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(comp);
            f.pack();
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }

  • Masking and clip art with transparent backgrounds

    I'm new to iWeb and am creating a travel blog. So far love the simplicity of it. However, when I try to add clip art type images or graphics with transparent backgrounds I always get a white border around them. I have tried to mask or crop the border out but no dice. Any help?!
    Also, if anyone can recommend a good source for travel or photo related clip art let me know. The iWeb "Roadtrip" template seems to have some cute items - maps, scissors, tape, etc. - but there is not much there.
    Thanks everyone.

    Welcome to the Apple Discussions. That's the default border for added image files. Go to the Inspector/Graphic pane and take off the frame/stroke that is added by default.
    Click to view full size
    Be sure to post a request to remove that default border at http://www.apple.com/feedback/iweb.html. The more complaints the better.
    OT

  • Movies with transparent backgrounds don't display in KN4

    In KN4, movies with transparent backgrounds (such as the countdown timers sold by KeynoteUser.com) no longer display when the show is presented. They clearly function when creating the slide, but not during presentation. I'm running the show on a MacBook Core Duo with 10.4.10 and GMA 950 graphics chips with 64 MB VRAM. This might be an issue with the GMA graphics chip although the movies worked perfectly with KN3 and earlier. Has anyone else observed this problem?

    The Keynote 4.0.1 update has fixed this problem. Thanks Apple!

  • How in Illustrator I write text with transparent background ?

    How in Illustrator I write text with transparent background ?

    that is correct. You open it in AI and you have an option to use area text, you first take the text tool and drag to make a text frame, which wors like it does in a layout program. Or you click the text tool any where on the canvas and just start typing if you want to make another line you either hit the return (enter) key or for  soft return use shift/return (enter).
    The default is a transparent background.
    All art i Illustrator is on a transparent background unless you add an object behind other objects that has a fill color.

  • How to create image slice with transparent background without white halo around?

    Hi, I want to make slice image with transparent background. I set the slice option background color to my background color. But when the image is on my html page set against the same background color, it has white halo around:
    How can I get rid of the white halo?
    I need the slice image to have transparent background and not have a color background because it's going on a rollover button with the background change. I don't want it to look like this on rollover:

    >it looks to me like you built it with that "halo" to start with.
    No, I didn't put in the halo myself. The shape is a character from the Webdings font. It's set to some darker fill color and set on a transparent background. Photoshop put the white halo there after "Save For Web".
    > Make your graphic on a transparent background and Save for Web
    I did exactly that, see:
    I set the slice background to my color. I try the Matte option and come out the same with white halo.
    It seems I'm not making Photoshop antialias to my background color, instead Photoshop just antialias to white.
    What else do I need to do?

  • Export with Transparent Background

    I do realize this has been asked again and again.  Just making a reality check. I created a lower third. Time and time again the import into Final Cut Pro was on a solid black background instead of a transparency.
    I followed every post and followed the directions - with no success.
    Finally I exported my Motion lower third as a Template.  The effect appears as a Generator in Final Cut.  When I use the created Generator in my timeline the lower third has a proper transparency and works properly.
    Is that really the only way to import a Motion graphic with transparent background??     Yes, I did try creating a Movie in ProRes 4444, my project does have a transparent background selected, etc.  I feel as if I am missing something.

    Much appreciated  :-)
    I purchased the lower third from Videohive.  It has the basic graphic but lacks titles. While I was watching Motion tuturials, I thought I would customize the lower third with a fancy text animation.
    I tried a few experiments based on what you said.  I see now.
    So it appears that even though my proxy media lacks the alpha channel and does not display with a transparency, the moment I switch FCP to view Optimized/Original media, the transparency works correctly. 
    So I assume I can still use proxy media (if needed) and ignore the lack of transparency until my final render.  As long as I am exporting from Motion using ProRes 4444 it should work correctly.
    Does that reasoning make sense?
    Looking at many posts across the internet, I think this is the very issue that has tripped up many people.
    Thank you for your helpful comment. I was going nuts trying to figure it out.

Maybe you are looking for

  • Fields missing from webservice datasource in SSRS

    We are using a XML webservice as a datasource for SSRS. The webservice is returning  the hierarchy of departments of our company. The data is consumed by SSRS but some fields are missing. This is (simplified) what is returned by the webservice: <depa

  • Mid month period not being calculated in pay slip

    Hi Experts, Mid month period given in 0008 is not being calculated.       e.g. if i hire some one on 16.01.09, then 0008 data should be calculated for those days only (e.g. 16 days) in pay slip.   But in my case it is taking full amount of 0008.  Can

  • F-90 acquisition error

    I use transaction type 100 for F-90, if I enter inter-company vendor, it pops up below message: Transaction type not possible (Posting to affiliated company) Message no. AA390 Diagnosis For the current document, you specified either implicitly (via t

  • In CMOD creating Project

    Dear Expert,             While doing the CMOD, when i click on the Include i m getting the error "Program names ZX... are reserved for includes of exit function groups". i have done( Go to transaction CMOD - Create a project called ZVA01 - Choose the

  • User Entry Variable - brings back date from several months past - cache?

    Hi , Please excuse this question if this has already been addressed.  I have searched sdn and could not find a posting. This may seem silly but in a query that is refreshed weekly, it has several variables that can be populated. The data - 0calday -