Exemplo n.º 1
0
        /// <summary>
        /// Creates a new ICC-Profile for <paramref name="dib"/>.
        /// </summary>
        /// <param name="dib">Handle to a FreeImage bitmap.</param>
        /// <param name="data">The ICC-Profile data.</param>
        /// <param name="size">Number of bytes to use from data.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="dib"/> is null.</exception>
        public unsafe FIICCPROFILE(FIBITMAP dib, byte[] data, int size)
        {
            if (dib.IsNull)
            {
                throw new ArgumentNullException("dib");
            }
            FIICCPROFILE prof;

            size       = Math.Min(size, (int)data.Length);
            prof       = *(FIICCPROFILE *)FreeImage.CreateICCProfile(dib, data, size);
            this.flags = prof.flags;
            this.size  = prof.size;
            this.data  = prof.data;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new ICC-Profile for <paramref name="dib" />.
        /// </summary>
        /// <param name="dib">Handle to a FreeImage bitmap.</param>
        /// <param name="data">The ICC-Profile data.</param>
        /// <param name="size">Number of bytes to use from data.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="dib" /> is null.
        /// </exception>
        public unsafe FIICCPROFILE(FIBITMAP dib, byte[] data, int size)
        {
            if (dib.IsNull)
            {
                throw new ArgumentNullException("dib");
            }

            FIICCPROFILE prof;

            size        = Math.Min(size, data.Length);
            prof        = *(FIICCPROFILE *)FreeImage.CreateICCProfile(dib, data, size);
            Flags       = prof.Flags;
            Size        = prof.Size;
            DataPointer = prof.DataPointer;
        }