WebPicture

From Xojo Documentation

Class (inherits from WebFile)

Creates a picture that can be used by the web browser, either for display or downloading.

Properties
Cached fa-lock-32.png Height Session
Data Identifier fa-lock-32.png URL fa-lock-32.png
FileName MIMEType UseCompression
ForceDownload OnDownloaded Width


Methods
Preload


Constructors

WebPicture.Constructor(Source as Picture, Format as String="public.png")


WebPicture.Constructor(data as String, FileName as String)


WebPicture.Constructor(file as FolderItem)


WebPicture.Constructor(mb as MemoryBlock, FileName as String)


WebPicture.Constructor(width As Integer, height As Integer, files() As FolderItem)


Notes

WebPicture has an Operator_Convert method which will turn itself from/into a Picture. Both the following syntaxes are legal:

Dim p As Picture = MyWebPicture
Dim wp As WebPicture = p

Converting Picture to WebPicture gives you a PNG encoded image. For better performance avoid converting from WebPicture to Picture in your application and keep original Picture object.

Unlike WebFile, WebPicture defaults the session property to the session which it was created in.

Example

Convert a Picture, created at runtime to a WebPicture to display using a WebImageView:

Dim p As New Picture(100, 100, 32)
p.Graphics.ForeColor = &c0000ff // Blue
p.Graphics.FillRect(10, 10, 50, 50)

Dim wp As WebPicture = p
ImageView1.Picture = wp

See Also

HTMLViewer, WebFile, WebImageView, Picture