形状指定 FPM オブジェクト生成(矩形)

Namespace: fvalgcli
Assembly: fvalgcli (in fvalgcli.dll) Version: 3.1.0.0 (3.1.0.11)

Syntax

C#
public static FHANDLE fnFIE_fpm_alloc_shape_rectangle(
	double width,
	double height,
	bool bright,
	f_fpm_mode matching_mode,
	ref int perr_code
)
Visual Basic
Public Shared Function fnFIE_fpm_alloc_shape_rectangle ( 
	width As Double,
	height As Double,
	bright As Boolean,
	matching_mode As f_fpm_mode,
	ByRef perr_code As Integer
) As FHANDLE

Parameters

width
Type: System..::..Double
矩形のX方向幅(3.0<=width, 単位:画素)
height
Type: System..::..Double
矩形のY方向高さ(3.0<=height, 単位:画素)
bright
Type: System..::..Boolean
矩形パタンの色
  • TRUE 指定矩形は白(背景よりも明るい)
  • FALSE 指定矩形は黒(背景よりも暗い)
matching_mode
Type: fvalgcli..::..f_fpm_mode
FPMを行う際のマッチングモード
  • F_FPM_NORMAL_MODE 通常モード
  • F_FPM_SPEED_MODE 高速モード
perr_code
Type: System..::..Int32%
正常終了、またはエラーコードを格納します。エラーコードを受け取る必要の無い場合は、IntPtr.Zero を指定することも可能です。
  • F_ERR_NONE 正常終了
  • F_ERR_INVALID_PARAM 引数異常
  • F_ERR_NOMEMORY メモリ不足
  • F_ERR_BUFFER_OVERFLOW バッファ不足エラー
  • F_ERR_NO_LICENCE ライセンスエラー

Return Value

Type: FHANDLE
正常終了した場合は、生成したFPMオブジェクトのハンドルを返します。 異常終了により生成できなかったときは IntPtr.Zero を返します。

Remarks

Examples

C# Copy imageCopy
//    $Revision: 1.1 $

using System;
using System.Collections.Generic;
using System.Text;
using fvalgcli;

namespace TC
{
    public partial class FIE
    {
        [FvPluginExecute]
        public void fnFIE_fpm_alloc_shape_rectangle()
        {
            FHANDLE hfpm = FHANDLE.Zero;

            try
            {
                double width = 100;
                double height = 80;
                bool bright = true;
                f_fpm_mode matching_mode = f_fpm_mode.F_FPM_SPEED_MODE;
                int perr_code = 0;

                // 処理の実行.
                hfpm = api.fnFIE_fpm_alloc_shape_rectangle(width, height, bright, matching_mode, ref perr_code);

                // エラー判定.
                Assert.IsTrue(perr_code == (int)f_err.F_ERR_NONE, "エラーが発生しました。({0})", (f_err)perr_code);

                // 確認.
                int num = 0;
                api.fnFIE_fpm_get_pattern_feature_num(hfpm, ref num);
                Console.WriteLine("fnFIE_fpm_alloc_shape_ellipse: num={0}", num);

                Assert.IsTrue(num > 0, "エラーが発生しました。(num={0})", num);
            }
            finally
            {
                // オブジェクトの開放.
                hfpm.Dispose();
            }
        }
    }
}


Visual Basic Copy imageCopy
'    $Revision: 1.1 $

Imports System.Collections.Generic
Imports System.Text
Imports fvalgcli

Public Partial Class FIE
    <FvPluginExecute> _
    Public Sub fnFIE_fpm_alloc_shape_rectangle()
        Dim hfpm As FHANDLE = FHANDLE.Zero

        Try
            Dim width As Double = 100
            Dim height As Double = 80
            Dim bright As Boolean = True
            Dim matching_mode As f_fpm_mode = f_fpm_mode.F_FPM_SPEED_MODE
            Dim perr_code As Integer = 0

            ' 処理の実行.
            hfpm = api.fnFIE_fpm_alloc_shape_rectangle(width, height, bright, matching_mode, perr_code)

            ' エラー判定.
            Assert.IsTrue(perr_code = CInt(f_err.F_ERR_NONE), "エラーが発生しました。({0})", CType(perr_code, f_err))

            ' 確認.
            Dim num As Integer = 0
            api.fnFIE_fpm_get_pattern_feature_num(hfpm, num)
            Console.WriteLine("fnFIE_fpm_alloc_shape_ellipse: num={0}", num)

            Assert.IsTrue(num > 0, "エラーが発生しました。(num={0})", num)
        Finally
            ' オブジェクトの開放.
            hfpm.Dispose()
        End Try
    End Sub
End Class

See Also