BitMiracle.LibTiff.Classic.Tiff.WarningExt C# (CSharp) Method

WarningExt() public static method

Invokes the library-wide warning handling methods to (normally) write a warning message to the Console.Error and passes client data to the warning handler.

The format is a composite format string that uses the same format as O:System.String.Format method. The method parameter, if not null, is printed before the message; it typically is used to identify the method in which a warning is detected.

The clientData parameter can be anything you want. It will be passed unchanged to the warning handler. Default warning handler does not use it. Only custom warning handlers may make use of it.

Applications that desire to capture control in the event of a warning should use SetErrorHandler to override the default error and warning handler.

public static WarningExt ( Tiff tif, object clientData, string method, string format ) : void
tif Tiff An instance of the class. Can be null.
clientData object The client data to be passed to warning handler.
method string The method in which a warning is detected.
format string A composite format string (see Remarks).
return void
        public static void WarningExt(Tiff tif, object clientData, string method, string format, params object[] args)
        {
            TiffErrorHandler errorHandler = getErrorHandler(tif);
            if (errorHandler == null)
                return;

            errorHandler.WarningHandler(tif, method, format, args);
            errorHandler.WarningHandlerExt(tif, clientData, method, format, args);
        }

Same methods

Tiff::WarningExt ( object clientData, string method, string format ) : void

Usage Example

示例#1
0
        /*
         * Fetch and set the SubjectDistance EXIF tag.
         */
        private bool fetchSubjectDistance(TiffDirEntry dir)
        {
            if (dir.tdir_count != 1 || dir.tdir_type != TiffType.RATIONAL)
            {
                Tiff.WarningExt(this, m_clientdata, m_name,
                                "incorrect count or type for SubjectDistance, tag ignored");

                return(false);
            }

            bool ok = false;

            byte[] b    = new byte[2 * sizeof(int)];
            int    read = fetchData(dir, b);

            if (read != 0)
            {
                int[] l = new int[2];
                l[0] = readInt(b, 0);
                l[1] = readInt(b, sizeof(int));

                float v;
                if (cvtRational(dir, l[0], l[1], out v))
                {
                    /*
                     * XXX: Numerator -1 means that we have infinite
                     * distance. Indicate that with a negative floating point
                     * SubjectDistance value.
                     */
                    ok = SetField(dir.tdir_tag, (l[0] != -1) ? v : -v);
                }
            }

            return(ok);
        }
All Usage Examples Of BitMiracle.LibTiff.Classic.Tiff::WarningExt
Tiff