/*! \brief Return information on a string. * \param [in] fontHandle Handle of font to use (0 for current handle) if * \b PlotType.GivenFont (bit 8) of flags set. * \param [in] str String to scan * \param [in] flags Plot type * \param [in] offset Offset of mouse click * \param [in,out] coordBlock Coordinate block for input if \b Font.PlotType.GivenBlock (bit 5) * of flags set and output if \b PlotType.ReturnBBox (bit 18) set, otherwise \b null. * \param [in,out] matrix Transformation matrix for input if \b PlotType.GivenMatrix (bit 6) * of flags set and output if \b PlotType.ReturnMatrix (bit 19) set, otherwise \b null. * \param [in] length Length of string to scan - if \b PlotType.GivenLength (bit 7) of flags set * \param [out] offsetReturn x,y coordinate offset to caret position - * if \b PlotType.ReturnCaretPos (bit 17) of flags set; else to split point, * or end of string if splitting not required * \param [out] splitCount Number of split characters encountered - * if \b PlotType.ReturnSplitCount (bit 20) of flags set * \return Index of point in string of caret position - if \b PlotType.ReturnCaretPos * (bit 17) of flags is set; else of split point, or of end of string if splitting * not required. */ public static int ScanString(IntPtr fontHandle, string str, PlotType flags, OS.Coord offset, Font.ScanCoordBlock coordBlock, OS.Matrix matrix, int length, OS.Coord offsetReturn, out int splitCount) { int result_index; OS.ThrowOnError(NativeMethods.Font_ScanString(fontHandle, str, flags, offset.X, offset.Y, coordBlock, matrix, length, out result_index, out offsetReturn.X, out offsetReturn.Y, out splitCount)); return(result_index); }
internal static extern IntPtr Font_ScanString(IntPtr font, string s, Font.PlotType flags, int x, int y, [In, Out] Font.ScanCoordBlock coordBlock, [In, Out] OS.Matrix matrix, int length, out int splitIndexOut, out int xOut, out int yOut, out int splitCountOut);
/*! \brief Return information on a string. * \param[in] str String to scan * \param[in] flags Plot type * \param[in] offset Offset of mouse click * \param[in,out] coordBlock Coordinate block * \param[in] length Length of string to scan - if \b PlotType.GivenLength (bit 7) of flags set * \param[out] offsetReturn x,y coordinate offset to caret position - * if \b PlotType.ReturnCaretPos (bit 17) of flags set; else to split point, * or end of string if splitting not required * \param[out] splitCount Number of split characters encountered - * if \b PlotType.ReturnSplitCount (bit 20) of flags set * \return Index of point in string of caret position - if \b PlotType.ReturnCaretPos * (bit 17) of flags is set; else of split point, or of end of string if splitting * not required. * * \note * Automatically: * \li Sets flag bit 5 to indicate coordinate block in use * \li Sets flag bit 8 to indicate font handle in use * \li Clears flag bits 6 & 19 to indicate transformation matrix not in use. * * All coordinates must be in millipoints. */ public int ScanString(string str, PlotType flags, OS.Coord offset, Font.ScanCoordBlock coordBlock, int length, OS.Coord offsetReturn, out int splitCount) { flags |= PlotType.GivenBlock | PlotType.GivenFont; flags &= ~(PlotType.GivenMatrix | PlotType.ReturnMatrix); return(Font.ScanString(Handle, str, flags, offset, coordBlock, null, length, offsetReturn, out splitCount)); }