예제 #1
0
		protected override unsafe void OnUpdateFaderImage(Bitmap bmp)
		{
			if (bmp.PixelFormat != PixelFormat.Format32bppArgb) return;
			BitmapData bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
			                             ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
			ColorBgra* scan0 = (ColorBgra*) bd.Scan0;
			//draw fader image
			LAB curr = new LAB(0.0, _color.a, _color.b);
			double delta_L = 100.0/(double) bd.Width;
			for (int x = 0; x < bd.Width; x++, scan0++,curr.L += delta_L) {
				scan0[0] = ColorBgra.FromArgb(curr.ToXYZ().ToRGB());
			}
			//end
			bmp.UnlockBits(bd);
		}
 protected unsafe override void OnUpdatePlaneImage(Bitmap bmp)
 {
     if(bmp.PixelFormat!=PixelFormat.Format32bppArgb) return;
     BitmapData bd=bmp.LockBits(new Rectangle(0,0,bmp.Width,bmp.Height),
         ImageLockMode.WriteOnly,PixelFormat.Format32bppArgb);
     ColorBgra* scan0=(ColorBgra*)bd.Scan0;
     //draw plane image
     LAB curr=new LAB(100.0,_color.a,-128.0);
     double
         delta_L=-100.0/(double)bd.Height,
         delta_b=255.0/(double)bd.Width;
     for(int y=0; y<bd.Height; y++, curr.b=-128.0, curr.L+=delta_L)
     {
         for(int x=0; x<bd.Width; x++, scan0++,curr.b+=delta_b)
         {
             scan0[0]=ColorBgra.FromArgb(curr.ToXYZ().ToRGB());
         }
     }
     //end
     bmp.UnlockBits(bd);
 }