Visit Gigasoft's Web Site
 ProEssentials v9 Help

JPEGToStream Method

Scope All ProEssentials OCX Interfaces


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


The JPEGToStream method is used primarily within an ActiveServerPage to produce a dynamically generated JPEG 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: PNGToStream, OCX Methods.


HTML / ASP Example

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





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

<IMG src = "">



Part2: ASP page "buildjpg.asp" containing JPEGToStream.



dim myobj

Set myobj = server.CreateObject("PEGOB.Pegobctrl.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.JPEGToStream(300,300))


Set myobj = Nothing



See Also: JpegQuality