From 86249e6c235f398544b55ddbc6939c6eae9d4016 Mon Sep 17 00:00:00 2001 From: jesus Date: Fri, 24 Jan 2014 07:36:42 +0000 Subject: [PATCH] docs, document TDbImage OnDbImageRead, OnDbImageWrite, WriteHeader git-svn-id: trunk@43786 - --- docs/xml/lcl/dbctrls.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/xml/lcl/dbctrls.xml b/docs/xml/lcl/dbctrls.xml index f84ca26806..452b9ced97 100644 --- a/docs/xml/lcl/dbctrls.xml +++ b/docs/xml/lcl/dbctrls.xml @@ -6187,6 +6187,15 @@ Reads flag or writes one to determine if a hint is to be shown when mouse hovers + Write a header in the image stream.

The WriteHeader property controls whether or not a header will be written to the image stream. By default a header will be written, this helps to efficiently identify the image format when loading. The writing of a header in the image stream could be a problem if the database will be shared with external applications who do not expect a header in the image stream. In this case, set WriteHeader value to false in order to skip the header writing. +

The default value is true.

Note: The WriteHeader value is ignored if OnDbImageWrite event is implemented. +

+
+
Event to read a custom header from image stream.

By default, the TDbImage component expect a header at the start of the image stream, this helps to efficiently identify the image format contained in the data stream. On writing, the header is controlled by the WriteHeader property or the OnDbImageWrite event handler. When loading image data which was created by external applications, the data stream may not have a header or the header is not a format identifier that the TDbImage component would recognize.

The OnDbImageRead event, could be used to identify the image format in the data stream. In the GraphExt parameter it must return a format identifier corresponding to the registered image format. This format identifier could be read from the data stream provided in the s parameter. On return, the data stream should start with the raw image data.

If the OnDbImageRead handler was not implemented or if it returns an invalid format identifier, the TDbImage component will try to load the image by checking the data stream content. This means that is not necessary to write an OnDbImageRead event handler for the most common image formats, for example: jpg, png, gif or bmp.

The TDbImage component will be able to indentify the image format even if the data stream doesn't have a header for those TGraphic registered classes that implement the IsStreamFormatSupported method.

+
+
Event to write a custom header into image stream.

Use OnDBImageWrite to write a custom header in the image stream. This header could be "decoded" in the handler for the OnDbImageRead event when loading. The header will be followed by the image raw data.

By default, TDbImage will write an image header in order to efficiently identify the image format when loading. This behaviour is controlled by the WriteHeader property. If Database will be shared by external applications, it is important to not write an image header. This could be achieved by writing an empty handler for OnDbImageWrite. Note that an empty handler has the same effect than setting WriteHeader to false.

OnDbImageWrite has precedence over the WriteHeader property.

+
+