Animatroller.Framework.LogicalDevice.VirtualPixel2D3.PixelDevice.PixelDevice C# (CSharp) Метод

PixelDevice() публичный Метод

public PixelDevice ( int pixelWidth, int pixelHeight, Utility.PixelMap[]>.Dictionary pixelMapping, Action pixelsChangedAction ) : System
pixelWidth int
pixelHeight int
pixelMapping Utility.PixelMap[]>.Dictionary
pixelsChangedAction Action
Результат System
            public PixelDevice(int pixelWidth, int pixelHeight, Dictionary<int, Utility.PixelMap[]> pixelMapping, Action<byte[]> pixelsChangedAction)
            {
                this.pixelsChangedAction = pixelsChangedAction;

                this.outputBitmap = new Bitmap(pixelWidth, pixelHeight, PixelFormat.Format24bppRgb);
                this.outputGraphics = Graphics.FromImage(this.outputBitmap);
                this.outputRectangle = new Rectangle(0, 0, pixelWidth, pixelHeight);

                int bytesPerPixel = System.Drawing.Bitmap.GetPixelFormatSize(this.outputBitmap.PixelFormat) / 8;
                this.stride = 4 * ((this.outputBitmap.Width * bytesPerPixel + 3) / 4);
                int byteCount = stride * this.outputBitmap.Height;
                this.pixels = new byte[bytesPerPixel * this.outputBitmap.Width * this.outputBitmap.Height];
                this.pixelMapping = new int[byteCount];

                UpdatePixelMapping(pixelMapping);
            }