Exemplo n.º 1
0
 public PixColor this[int index] {
     get {
         int color;
         if (LeptonicaApi.Native.pixcmapGetColor32(this.Handle, index, out color) == 0)
         {
             return(PixColor.FromRgb(( uint )color));
         }
         throw new InvalidOperationException("Failed to retrieve color.");
     }
     set {
         if (LeptonicaApi.Native.pixcmapResetColor(this.Handle, index, value.Red, value.Green, value.Blue) != 0)
         {
             throw new InvalidOperationException("Failed to reset color.");
         }
     }
 }
Exemplo n.º 2
0
 public PixColor this[int index]
 {
     get
     {
         int color;
         if (Interop.LeptonicaApiSignatures.pixcmapGetColor32(handle, index, out color) == 0)
         {
             return(PixColor.FromRgb((uint)color));
         }
         else
         {
             throw new InvalidOperationException("Failed to retrieve color.");
         }
     }
     set
     {
         if (Interop.LeptonicaApiSignatures.pixcmapResetColor(handle, index, value.Red, value.Green, value.Blue) != 0)
         {
             throw new InvalidOperationException("Failed to reset color.");
         }
     }
 }