예제 #1
0
파일: Graphics.cs 프로젝트: sbarisic/Kernel
        public static Graphics FromHdc(IntPtr hdc)
        {
            if (hdc != IntPtr.Zero)
            {
                throw new NotImplementedException();
            }
            int         xSize, ySize;
            PixelFormat pixelFormat;
            IntPtr      native = LibIGraph.GetScreen(out xSize, out ySize, out pixelFormat);

            if (native == IntPtr.Zero)
            {
                throw new Exception("CreateScreen() failed");
            }
            return(new Graphics(xSize, ySize, pixelFormat, native));
        }