Visit Gigasoft's Web Site
ProEssentials v7 Help

SVGToStream OCX Method

Scope All ProEssentials OCX Interfaces

 

SVGToStream( nXPixels As Integer, nYPixels As Integer, bCompress As Boolean) As Variant

 

The SVGToStream method is used primarily within an Active Server Page to produce a dynamically generated SVG image upon page request. To insure image quality, the aspect ratio (width/height) must be between 0.333 and 10.0.

 

Parameter

Description

nXPixels

Width in Pixels, value range 32 to 2000

nYPixels

Height in Pixels, value range 32 to 2000

bCompress

True to compress output

 

Comments

See Also: PNGToStream, JPEGToStream, OCX Methods.

 

HTML / ASP Example

The following is an example of using SVGToStream. The example contains two parts, the first part is an HTML page that references the ASP page, the second part contains the ASP page.

 

Part1: HTML page references ASP page containing SVGToStream.

 

<HTML>

<HEAD></HEAD>

<body>
<p>Test SVG Page</p>
<object data="http://myserver/mysvg.asp" type="image/svg+xml"    width=400 height=400> </object>

</body>
</HTML>

 

Part2: ASP page "mysvg.asp" containing SVGToStream.

<%

dim myobj

Set myobj = server.CreateObject("PEGOD.Pegodctrl.1")

myobj.MainTitle = "Hello Internet"

myobj.Subsets = 4

myobj.Points = 12

 

dim i

dim j

for i = 0 to 3

  for j = 0 to 11

    myobj.YData(i,j) = 5 + Rnd(20)

  next

next

 

Response.BinaryWrite (myobj.SVGToStream(400, 400, True))

 

Set myobj = Nothing

%>