Transparent WebView

  • Hi!

    I want to display a transparent Flash animation in a transparent window. I could
    instantiate a transparent window, place a WebView on it, and display the Flash
    animation there on the WebView. Compilable  sample code demonstrating the
    problem is at
    http://www.cs.auckland.ac.nz/~mano/WebViewTest.zip

    The problem is that the WebView itself isn't transparent, so the background
    shows. On the web, there are several questions on how to get this to be
    transparent, and there are some answers which do not appear to work.

    A popular solution appears to be placing the Flash object on a transparent HTML
    page and displaying this page on the WebView (rather than directly displaying
    the Flash animation on the WebView); in addition this solution requires using an
    undocumented WebView method setDrawsBackground to turn off drawing background
    of WebView.

    Some of the commented out code fragments in WebViewWindow.m essentially
    attempted this solution. But it does not work.

    If I replace the WebView with NSImageView and place a transparent GIF there,
    then I get the transparent animation. Therefore the issue appears to be with
    WebView (rather than the window).

    I would appreciate getting some help on how this could be solved.

    Cheers,
    Mano
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today