Beispiel #1
0
        public void updatePicture()
        {
            if (!pictureBox.InvokeRequired)
            {
                if (bitmap == null)
                {
                    bitmap = new Bitmap(bitmapWidth, bitmapHeight);
                }

                if (position < 0 || position > (sampleNum - 1))
                {
                    ArrayClear();
                }

                BitmapData CanvasData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);
                IntPtr     ptr        = CanvasData.Scan0;
                Marshal.Copy(dateArray, 0, ptr, bitmapWidth * bitmapHeight * 3);
                bitmap.UnlockBits(CanvasData);

                pictureBox.Image = bitmap;
            }
            else
            {
                if (updatePictureFunc == null)
                {
                    updatePictureFunc = new updatePictureCallBack(updatePicture);
                }

                pictureBox.Invoke(updatePictureFunc);
            }
        }
Beispiel #2
0
        public void updatePicture()
        {
            if (!tchart.InvokeRequired)
            {
                if (bitmap == null)
                {
                    bitmap = new Bitmap(bitmapWidth, bitmapHeight);
                }

                BitmapData CanvasData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);
                IntPtr     ptr        = CanvasData.Scan0;
                Marshal.Copy(dateArray, 0, ptr, bitmapWidth * bitmapHeight * 3);
                bitmap.UnlockBits(CanvasData);

                tchart.Walls.Back.Image = bitmap;
            }
            else
            {
                if (updatePictureFunc == null)
                {
                    updatePictureFunc = new updatePictureCallBack(updatePicture);
                }

                tchart.Invoke(updatePictureFunc);
            }
        }
Beispiel #3
0
        public void UpdateBscanPic()
        {
            if (!pictureBox.InvokeRequired)
            {
                if (bitmap == null)
                {
                    bitmap = new Bitmap(width, height);
                }

                BitmapData CanvasData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);
                IntPtr     ptr        = CanvasData.Scan0;
                Marshal.Copy(dateArray, 0, ptr, width * height * 3);
                bitmap.UnlockBits(CanvasData);

                if (pictureBox.Visible == false)
                {
                    pictureBox.Visible = true;
                }
                pictureBox.Image = bitmap;
            }
            else
            {
                if (updatePictureFunc == null)
                {
                    updatePictureFunc = new updatePictureCallBack(UpdateBscanPic);
                }

                pictureBox.Invoke(updatePictureFunc);
            }
        }