Exemplo n.º 1
0
        public int Blue(GDColor color)
        {
            GDImage imageData = (GDImage)Marshal.PtrToStructure(this.Handle, typeof(GDImage));

            if (imageData.trueColor > 0)
            {
                return(color & 0x0000FF);
            }

            return(imageData.blue[color]);
        }
Exemplo n.º 2
0
        public int Green(GDColor color)
        {
            GDImage imageData = (GDImage)Marshal.PtrToStructure(this.Handle, typeof(GDImage));

            if (imageData.trueColor > 0)
            {
                return((color & 0x00FF00) >> 8);
            }

            return(imageData.green[color]);
        }
Exemplo n.º 3
0
        public int Alpha(GDColor color)
        {
            GDImage imageData = (GDImage)Marshal.PtrToStructure(this.Handle, typeof(GDImage));

            if (imageData.trueColor > 0)
            {
                return((color & 0x7F000000) >> 24);
            }

            return(imageData.alpha[color]);
        }
Exemplo n.º 4
0
        public int Red(GDColor color)
        {
            GDImage imageData = (GDImage)Marshal.PtrToStructure(this.Handle, typeof(GDImage));

            if (imageData.trueColor > 0)
            {
                return((color & 0xFF0000) >> 16);
            }

            return(imageData.red[color]);
        }
Exemplo n.º 5
0
 private int GetStructInt(string field)
 {
     return(Marshal.ReadInt32(this.Handle, GDImage.GetOffset(field)));
 }