Beispiel #1
0
        public unsafe void Paint(Pad Pad)
        {
            TView tview = TView.View(Pad);

            this.Left  = tview.Left;
            this.Top   = tview.Top;
            this.W     = tview.H;
            this.H     = tview.H;
            this.o     = tview.O - new TVec3((double)this.Left, (double)this.Top, 0.0);
            this.Lx    = tview.Lx;
            this.Ly    = tview.Ly;
            this.Lz    = tview.Lz;
            this.Light = tview.Light;
            if (this.Look == EChartLook.SurfaceOnly)
            {
                this.BitmapWriteOnly = false;
            }
            Bitmap bm = new Bitmap(this.W, this.H, PixelFormat.Format32bppRgb);

            this.BackgroundIntoBitmapIfNeeded(Pad, bm);
            Rectangle  rect       = new Rectangle(0, 0, this.W, this.H);
            BitmapData bitmapdata = bm.LockBits(rect, this.BitmapWriteOnly ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);

            this.PaintBuffer((int *)bitmapdata.Scan0.ToPointer());
            bm.UnlockBits(bitmapdata);
            Color transparentColor = Color.FromArgb((int)byte.MaxValue, 0, 0, 0);

            bm.MakeTransparent(transparentColor);
            Pad.Graphics.DrawImage((Image)bm, this.Left, this.Top);
        }
Beispiel #2
0
 public unsafe void Paint(Pad Pad)
 {
     TView tview = TView.View(Pad);
     this.Left = tview.Left;
     this.Top = tview.Top;
     this.W = tview.H;
     this.H = tview.H;
     this.o = tview.O - new TVec3((double) this.Left, (double) this.Top, 0.0);
     this.Lx = tview.Lx;
     this.Ly = tview.Ly;
     this.Lz = tview.Lz;
     this.Light = tview.Light;
     if (this.Look == EChartLook.SurfaceOnly)
         this.BitmapWriteOnly = false;
     Bitmap bm = new Bitmap(this.W, this.H, PixelFormat.Format32bppRgb);
     this.BackgroundIntoBitmapIfNeeded(Pad, bm);
     Rectangle rect = new Rectangle(0, 0, this.W, this.H);
     BitmapData bitmapdata = bm.LockBits(rect, this.BitmapWriteOnly ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
     this.PaintBuffer((int*) bitmapdata.Scan0.ToPointer());
     bm.UnlockBits(bitmapdata);
     Color transparentColor = Color.FromArgb((int) byte.MaxValue, 0, 0, 0);
     bm.MakeTransparent(transparentColor);
     Pad.Graphics.DrawImage((Image) bm, this.Left, this.Top);
 }