This Question is Answered

1 "correct" answer available (5 pts) 15 "helpful" answers available (3 pts)
4 Replies Last post: May 6, 2008 6:53 PM by cronos

How to make an applet "transparent"?

May 5, 2008 10:28 PM

Click to view cronos's profile Level 1 cronos 3 posts since
May 5, 2008

I've tried make a Curl Applet transparent embedded in HTML page.

I wrote two layer with DIV tag in HTML code, one is for background in plain HTML, the other includes OBJECT tag to load Curl applet.

I tried to set background for the applet with the code following, but it was shown as "white" always.

{set-document-properties
background = "transparent"
}

or

{set-document-properties
background = {Background.tiled
pattern = {FillPattern.get-transparent}
}
}

Do you have any idea or is it impossible?

Click to view URPradhan's profile BlackBelt URPradhan 166 posts since
Mar 6, 2008
1. Re: How to make an applet "transparent"? May 5, 2008 11:29 PM
May be your page's background is white which is default and as your are setting your applets background to transparent its displaying the page's background = white.
Set the page's background to any other color and see if there is any difference.

//Thanx
Click to view cronos's profile Level 1 cronos 3 posts since
May 5, 2008
2. Re: How to make an applet "transparent"? May 5, 2008 11:59 PM
in response to: URPradhan
Thank you for your suggestion, URPradhan.

but after all the trial, I haven't found any solution yet. Here's some HTML code I've used for your information.

and I don't really think that all the elements need the background properties shown below.

<body>
<!-- background area (background) -->
<div style="position:absolute; top:0px; left:0; border:0px solid yellow; width:100%; height:100%; z-index:1; ">
<font style="font-size: 100px;">Hello, world!</font>
</div>

<!-- <div style="position:absolute; top:0px; left:0; border:0px solid yellow; width:100%; height:100%; z-index:2; background: transparent;">
<font style="font-size: 200px;">I can see this overlayed message.</font>
</div> --> <!-- uncomment to see the transparent layer -->

<!-- main body (Curl Applet) -->
<div style="position:absolute; top:0px; left:0; border:0px solid black; width:100%; height:100%; z-index:2; background: transparent;">
<OBJECT ID="CurlObject" DATA="curl/start.curl" TYPE="text/vnd.curl" width=100% height=100% style="background: transparent;">
You need to install the
<a href="http://www.curl.com/download/rte/">Curl RTE</a>
to run this applet.
</OBJECT>
</div>
</body>

I've also tried iframe using allowTransparency="true" tag.

Any help will be appreciated.

Click to view Duke's profile Curl Duke 179 posts since
Oct 17, 2007
3. Re: How to make an applet "transparent"? May 6, 2008 8:56 AM
in response to: cronos
I don't think there is any way to do this. Even if you tried the alternate approach of trying to do it in Curl using EmbeddedBrowserGraphic to put the HTML in the Curl applet (but maybe someone will correct me if I'm wrong about this).

I think the implementation detail is that Curl is actually aligning its own window (a Curl View) over the browser window, and there is currently no way to make a Curl applet's window (View or some related class) transparent in the way that you want.

Setting the View's background to transparent is not really useful. If what you want is a View that is essentially non-rectangular, or alpha-blended but only in spots, that's not a feature we provide. Maybe View.set-opacity (added in Curl 6.0) can do something similar to what you want (supported on the Mac, and
Windows XP and later).

The way drawing works is that you start out with your backing store as undefined, meaning you should paint all of the pixels in the invalidated region to be sure that they are reasonable. Having an opaque background on a View ensures this. Setting the View's background to transparent just means the background won't paint -- thus, you'll get whatever's in the backing store already, which will likely include the output from other windows or previous drawing operations.
Click to view cronos's profile Level 1 cronos 3 posts since
May 5, 2008
4. Re: How to make an applet "transparent"? May 6, 2008 6:54 PM
in response to: Duke
Thank you for the answer.

I think I understand how it works and why I can't do that I asked. But I got an alternate answer though


because what I exactly wanted is to display HTML in Curl background. I didn't think it's a good idea


to use ActiveX of Internet Explore in Curl. The EmbeddedBrowserGraphic you gave class will be the


best way to do it, I guess, if it's not an ActiveX.