コード例 #1
0
		/// <summary> Determines whether visual supports true color (32 or 24 bit depth). </summary>
		/// <param name='display'> The display pointer, that specifies the connection to the X server </param>
		/// <param name='scrnID'> The screen number, that specifies the appropriate screen on the host server. </param>
		/// <returns> <c>true</c> if visual supports direct color, otherwise, <c>false</c>. </returns>
		public static bool IsTrueColorVisual (IntPtr display, TInt scrnID)
		{
			X11lib.XVisualInfo	visInfo = new X11lib.XVisualInfo();
			
			if (X11lib.XMatchVisualInfo (display, scrnID, (TInt)32, TrueColor, ref visInfo) != 0)
			{
				//X11lib.XFree (visInfo);
				return true;
			}
			else if (X11lib.XMatchVisualInfo (display, scrnID, (TInt)24, TrueColor, ref visInfo) != 0)
			{
				//X11lib.XFree (visInfo);
				return true;
			}
			else
				return false;
		}
コード例 #2
0
ファイル: X11ColorModel.cs プロジェクト: kobbst/X11_Xlib
        /// <summary> Determines whether visual supports direct color (32 or 24 bit depth). </summary>
        /// <param name='display'> The display pointer, that specifies the connection to the X server </param>
        /// <param name='scrnID'> The screen number, that specifies the appropriate screen on the host server. </param>
        /// <returns> <c>true</c> if visual supports direct color, otherwise, <c>false</c>. </returns>
        public static bool IsDirectColorVisual(IntPtr display, TInt scrnID)
        {
            X11lib.XVisualInfo visInfo = new X11lib.XVisualInfo();

            if (X11lib.XMatchVisualInfo(display, scrnID, (TInt)32, DirectColor, ref visInfo) != 0)
            {
                //X11lib.XFree (visInfo);
                return(true);
            }
            else if (X11lib.XMatchVisualInfo(display, scrnID, (TInt)24, DirectColor, ref visInfo) != 0)
            {
                //X11lib.XFree (visInfo);
                return(true);
            }
            else
            {
                return(false);
            }
        }