TiVCLComponent.GetBytesJPEG

TiVCLComponent See Also

Gets a JPEG encoded image of the component for use in ASP web pages.

function GetBytesJPEG(Compression: Integer; Progressive: Boolean): OleVariant;

Description

Use GetBytesJPEG to get a JPEG encoded image of the component of type OleVariant (VT_ARRAY | VT_UI1), which is a variant array of unsigned one-byte characters. JPEG is a lossy-compressed, pixel-based representation of the component. This function is useful in Microsoft Internet Information Server (IIS Server) ASP web pages where you wish to display a static graphic of the component on a web browser. The JPEG format image is compatible with any web browser on any platform.

Note: If you wish to display dynamic or interactive controls, you will need to instantiate the component on the end-client web browser. The only drawback to doing that is that the end-user browser must be Microsoft Internet Explorer running under a Windows operating system (Intel Processor based). The GetBytesJPEG function allows you to display static content only.

Compression refers to the quality level of the compression you wish to apply to the image. A quality of 100 will give a higher quality result than 33. Valid values are between 0 and 100. With line art type graphics (like computer screen shots and component images), it is recommended that you leave the Compression value at 100 for the best results.

Progressive refers to the progressive encoding of the JPEG image. When this property is TRUE, then the image will be displayed progressively on a web page as it is downloaded.

Example

Delphi

Value := iComponent.GetBytesJPEG(100, True);

C++ Builder

Value = iComponent->GetBytesJPEG(100, True);

Microsoft IIS Server ASP Page (VBScript, ActiveX version of our controls only)

<%@ Language=VBScript %>

<!--METADATA NAME="iPlotLibrary" TYPE="TypeLib"

UUID="{DA259054-D93B-498C-8C10-DEBD83EF1357}"-->

<%

'Setup Response

Response.Expires = 0

Response.Buffer = True

Response.Clear

'Create ActiveX Control

Set iPlotX1 = Server.CreateObject("iPlotLibrary.iPlotX")

'Set Some Properties

iPlotX1.Width=500

iPlotX1.Height=300

iPlotX1.TitleText = "Test Chart 1"

iPlotX1.ToolBar(0).Visible = False

'Plot Some Random Data

for x = 0 to 100

iPlotX1.Channel(0).AddXY x, sin(x) * 100

next

'Stream JPEG Image

Response.ContentType = "image/jpeg"

Response.BinaryWrite(iPlotX1.GetBytesJPEG(100, TRUE))

'Cleanup

Set iPlotX1 = Nothing

%>

Contents | Index | Previous | Next