Images and Graphics

Last Updated: 9/16/2008



Sections above here:
Home  ยป  Development

Sections below here:

Topics in this section:
Rethinking the User Interface
Writing your first Delphi App
Images and Graphics
Extending Intraweb
Working with COM
Working with ClientDataSets
Creating PDA Applications
Error Handling
Control Size
Reading and writing custom cookies
Miscellaneous
Advanced Development
Session Locking

Search Documentation:

IntraWeb supports graphics via the use of templates, TIWImage, TIWDBImage and TIWImageFile Delphi components or the equivalents WebImage, ImageFile and DBImage controls in Visual Studio .NET. There are many ways to use graphics within IntraWeb, but these are the primary methods.

Templates

Use of graphics in templates is done by inserting the graphics directly into the HTML. Graphics may be served using the Files directory, or a standard web server. If using the files directory, then images should be referenced like this: <img href="../files/logo.jpg">. IW's template processor, will replace ../files/ with the correct path. Do not try to hard code this path, because it depends on the used session tracking method and on the deployment type (stand alone or ISAPI/DSO).

TIWImage and WebImage

TIWImage (WebImage in IntraWeb for Visual Studio .NET) is used for dynamic images. Each time an image is requested the image is converted to a JPG. This can be rather resource intensive and thus should only be used for images that will be changed as part of an application's function.

For an example of this, please see the Dynamic Interactive Image demonstration in the Features demo.

For static images that are not generated each time, use TIWImageFile.

TIWDBImage and DBImage

TIWDBImage (DBImage in IntraWeb for Visual Studio .NET) converts images from a database field to a JPG automatically. It is used just like a normal TDBImage, it performs all the work necessary to display the image from the database field into the browser.

For an example of TIWDBImage, see either of the FishFact demos.

TIWImageFile and ImageFile

TIWImageFile (ImageFile in IntraWeb for Visual Studio .NET) serves a file directly from a file on disk. Because it does no conversion of the image, TIWImageFile is an extremely efficient way to serve images and is much more efficient than TIWImage. If you are using images that are completely static, you should always use TIWImageFile.

TIWImageFile provides for design time support as well by displaying the image at design time. However the image is merely displayed, the image data is not stored with the form. Whenever displayed at design time the image is loaded from the file on disk.

The filename specifies a full path and filename to the image file to display at design time.

At run time, the path is ignored and only the filename is used. At run time, the image is expected to be in the files directory.

GIF Support

IntraWeb for Delphi can support GIF files however the install does not install GIF support. Please see the IntraWeb FAQ for details on how to use GIF files with IntraWeb. IntraWeb for Visual Studio .NET has GIF support.



(C) 2002-2009 - Atozed Software Ltd.