Exemplo n.º 1
0
        /***********************************************************************************\
        *  GD Creation/Destruction/Loading/Saving
        \***********************************************************************************/

        public GD(int width, int height, bool trueColor)
        {
            IntPtr imageHandle;

            if (trueColor)
            {
                imageHandle = GDImport.gdImageCreateTrueColor(width, height);
            }
            else
            {
                imageHandle = GDImport.gdImageCreate(width, height);
            }

            if (imageHandle == IntPtr.Zero)
            {
                throw new ApplicationException("ImageCreate failed.");
            }

            this.handle = new HandleRef(this, imageHandle);

            //this.imageData = (GDImage) Marshal.PtrToStructure( this.Handle, typeof( GDImage ) );
        }