Using Transparent Controls (Visual Basic Script)
The following example creates a web page with a bitmap as its background, and then adds a RasterView control. You can then press the button at the bottom of the page to toggle the transparency of the control.
1. |
Create an new HTML file and copy the following code to it ans save: |
<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
LEADRasterView1.RasterUnk.CreateBitmap 500, 150, 24
RasterProc.Fill LEADRasterView1.RasterUnk, 255
RasterFxd.TextTop = 50
RasterFxd.TextLeft = 0
RasterFxd.TextWidth = LEADRasterView1.DstWidth
RasterFxd.TextHeight = LEADRasterView1.DstHeight
RasterFxd.DrawFontColor = RGB(0, 255, 0)
RasterFxd.Font.Size = 18
RasterFxd.DrawPersistence = True
RasterFxd.DrawText LEADRasterView1.RasterUnk, 0, "Press the button below to toggle transparency", 0
End Sub
Sub ToggleTransparency()
If LEADRasterView1.Transparent = True Then
LEADRasterView1.Transparent = false
Else
LEADRasterView1.Transparent = True
End If
End Sub
//-->
</SCRIPT>
<TITLE>LEADTOOLS JavaScript COM Example</TITLE>
</HEAD>
<BODY OnLoad = "Window_OnLoad()" BACKGROUND="c:\save.jpg">
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
ALIGN="baseline"
BORDER="0"
WIDTH="1"
HEIGHT="1">
<PARAM NAME="LPKPath" VALUE="path to LPK file/LTOCX14n.Lpk">
</OBJECT><BR>
<OBJECT ID="LEADRasterView1" NAME="LEADRasterView1"
CLASSID="CLSID:00140708-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrvw14n.cab"
ALIGN="baseline"
BORDER="0"
WIDTH="90%"
HEIGHT="90%">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>
<OBJECT ID="RasterFxd" NAME="RasterFxd"
CLASSID="CLSID:0014072B-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrfd14n.cab">
<P>This is not supported in web browser.</P>
</OBJECT><BR>
<OBJECT ID="RasterProc" NAME="RasterProc"
CLASSID="CLSID:00140712-B1BA-11CE-ABC6-F5B2E79D9E3F"
CODEBASE="path to CAB file/Ltrpr14n.cab">
<P>This is not supported in the web browser.</P>
</OBJECT><BR>
<FORM NAME="LEADForm">
<INPUT TYPE="button" NAME="btnToggleTransparency" VALUE="Toggle Transparency" LANGUAGE="VBScript"
OnClick="ToggleTransparency">
</FORM>
</BODY>
</HTML>