Is there problem with Java and transparent images?

Discussion in 'Java' started by Ramon F Herrera, Jul 1, 2005.

  1. My Java application has a splash screen which was inspired on the ones
    that are displayed when the Adobe programs (Photoshop, Illustrator,
    InDesign) start up.

    There is an outside invisible rectangle and some features that pretent
    to "come out" of an inside white rectangle.

    You may have noticed how Photoshop has some feathers and Illustrator
    has some flowers; both have a white inside rectangle with a shadow that
    gives a 3-D impression.

    My problem is: I cannot achieve the mentioned effect with my Java
    application.

    Does anyone know whether Java has some limitaion displaying the
    transparency part? I get a gray rectangle which should be transparent.
    The image is a GIF.

    I really appreciate any tips and pointers since I spent a lot on that
    splash screen and now it makes my program look not so good.

    -Ramon
     
    Ramon F Herrera, Jul 1, 2005
    #1
    1. Advertising

  2. Ramon F Herrera

    jack Guest

    I am certain that Java can display transparent .gif's, but you may not
    be able to on a splash screen. Maybe you can find something in this
    article: http://www.javalobby.org/java/forums/t17720
    I think they use transparency in that example.
     
    jack, Jul 2, 2005
    #2
    1. Advertising

  3. On 1 Jul 2005 17:07:06 -0700, "jack" <> wrote:

    >I am certain that Java can display transparent .gif's, but you may not
    >be able to on a splash screen. Maybe you can find something in this
    >article: http://www.javalobby.org/java/forums/t17720
    >I think they use transparency in that example.


    I don't think you can display transparent images in Java (unless they
    changed something). The problem is that top level containers are not
    transparent or something.

    I think that example is a common workaround - capture the screen
    behind the window and then manipulate it to simulate the transparency.
    It works fine until the background changes, so try to make sure it
    doesn't.

    Darko
     
    Darko Aleksic, Jul 2, 2005
    #3
  4. Java supports transparent images in general (GIF, PNG), but it does not
    support transparent window backgrounds to display your transparent image on.

    You may want to check skinlf at http://www.l2fprod.com if you'ld like to use
    non-rectangular splash screens. The library provides some means and examples
    to do this, but unfortunately it relies on native code (Windows, X11) as
    their is no pure Java way to do it.

    Regards,
    Christian
     
    Christian Schlichtherle, Jul 2, 2005
    #4
  5. On Sat, 02 Jul 2005 07:10:16 GMT, Darko Aleksic wrote:

    > On 1 Jul 2005 17:07:06 -0700, "jack" <> wrote:
    >
    >>I am certain that Java can display transparent .gif's, but you may not
    >>be able to on a splash screen. Maybe you can find something in this
    >>article: http://www.javalobby.org/java/forums/t17720
    >>I think they use transparency in that example.

    >
    > I don't think you can display transparent images in Java ..


    No. Sun's 'WarpImage' source (part of the Java2D demo
    examples AFAIR) is supplied with a gif (surfing.gif) that
    has transparenct areas defined. If you flip the BG color
    to red or black, you can easily see that the BG shows
    through just fine.

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Jul 2, 2005
    #5
  6. On Sat, 02 Jul 2005 10:34:25 GMT, Andrew Thompson wrote:

    > On Sat, 02 Jul 2005 07:10:16 GMT, Darko Aleksic wrote:
    >
    >> On 1 Jul 2005 17:07:06 -0700, "jack" <> wrote:
    >>
    >>>I am certain that Java can display transparent .gif's, but you may not
    >>>be able to on a splash screen. Maybe you can find something in this
    >>>article: http://www.javalobby.org/java/forums/t17720
    >>>I think they use transparency in that example.

    >>
    >> I don't think you can display transparent images in Java ..


    Sorry - I misunderstood what you were saying. 'top-level'
    containers do not offer transparency - just like you said.
    Apologies for the (my) confusion.

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Jul 2, 2005
    #6
  7. On 1 Jul 2005 17:07:06 -0700, jack wrote:

    > I am certain that Java can display transparent .gif's, but you may not
    > be able to on a splash screen. Maybe you can find something in this
    > article: http://www.javalobby.org/java/forums/t17720
    > I think they use transparency in that example.


    Now that I have read this thread more carefully, and
    that link, I suggest this is the best way to go.

    The screen capture technique can work quite well.
    It experiences problems if you go to drag or move
    the component*, but that is not something that
    should apply to a splash screen.

    * Check this post (and resulting thread) for one experimental
    implementation of a draggable area with a transparent effect.
    <http://groups-beta.google.com/group/comp.lang.java.gui/msg/24d7b4000081cb7d?hl=en>

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Jul 2, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. eruess
    Replies:
    0
    Views:
    479
    eruess
    Aug 8, 2003
  2. MW de Jager

    Transparent images

    MW de Jager, Jun 10, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    464
    MW de Jager
    Jun 10, 2005
  3. =?Utf-8?B?TWVrZW4=?=

    Resize transparent gif images

    =?Utf-8?B?TWVrZW4=?=, Jul 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    614
    =?Utf-8?B?TWVrZW4=?=
    Jul 20, 2005
  4. babz
    Replies:
    8
    Views:
    16,696
    Roedy Green
    Sep 23, 2005
Loading...

Share This Page