Esempio n. 1
0
    /// <summary>
    /// ウィンドウ名と画像の表示モードと始めから表示しておく画像を指定して初期化
    /// </summary>
    /// <param name="name">ウィンドウの識別に用いられるウィンドウ名で,ウィンドウのタイトルバ ーに表示される.</param>
    /// <param name="flags">ウィンドウのフラグ</param>
    /// <param name="image">ウィンドウに表示する画像</param>
#else
        /// <summary>
        /// Creates a window
        /// </summary>
        /// <param name="name">Name of the window which is used as window identifier and appears in the window caption. </param>
        /// <param name="flags">Flags of the window. Currently the only supported flag is WindowMode.AutoSize. 
        /// If it is set, window size is automatically adjusted to fit the displayed image (see cvShowImage), while user can not change the window size manually. </param>
        /// <param name="image">Image to be shown.</param>
#endif
        public Window(string name, WindowMode flags, Mat image)
        {
            if (name == null)
                throw new ArgumentNullException(nameof(name));

            this.name = name;
            NativeMethods.highgui_namedWindow(name, (int) flags);

            this.image = image;
            ShowImage(image);
            trackbars = new Dictionary<string, CvTrackbar>();
            if (!Windows.ContainsKey(name))
            {
                Windows.Add(name, this);
            }
            this.callbackHandle = null;
        }
Esempio n. 2
0
        /// <summary>
        /// System.Runtime.InteropServices.GCHandle オブジェクトの内部整数表現を返します
        /// </summary>
        /// <param name="value">内部整数表現の取得元の System.Runtime.InteropServices.GCHandle オブジェクト</param>
        /// <returns>System.Runtime.InteropServices.GCHandle オブジェクトを表す System.IntPtr オブジェクト</returns>
#else
        /// <summary>
        ///
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
#endif
        public static IntPtr ToIntPtr(ScopedGCHandle value)
        {
            return(GCHandle.ToIntPtr(value.Handle));
        }
Esempio n. 3
0
        /// <summary>
        /// System.Runtime.InteropServices.GCHandle オブジェクトの内部整数表現を返します
        /// </summary>
        /// <param name="value">内部整数表現の取得元の System.Runtime.InteropServices.GCHandle オブジェクト</param>
        /// <returns>System.Runtime.InteropServices.GCHandle オブジェクトを表す System.IntPtr オブジェクト</returns>
#else
        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
#endif
        public static IntPtr ToIntPtr(ScopedGCHandle value)
        {
            return GCHandle.ToIntPtr(value.Handle);
        }