Visit Gigasoft's Web Site
 ProEssentials v9 Help

PNGToStream OCX Method

Scope All ProEssentials OCX Interfaces


PNGToStream( nXPixels As Integer, nYPixels As Integer ) As Variant


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





Width in Pixels, value range 32 to 2000


Height in Pixels, value range 32 to 2000



See Also: JPEGToStream, OCX Methods.


HTML / ASP Example

The following is an example of using PNGToStream. 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 PNGToStream.





<P>Run ASP Server Script via image src to display PNG</P>

<IMG src = "">



Part2: ASP page "buildpng.asp" containing PNGToStream.



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)




Response.BinaryWrite (myobj.PNGToStream(300,300))


Set myobj = Nothing