示例#1
0
        public ImageElement(FxImages image)
        {
            InitToolStrips();

            // set the position and the size of the element
            Position = new Vector.FxVector2f(0);
            Size = new Vector.FxVector2f(image.Image.Width, image.Image.Height);

            // set the size of the image
            Width = image.Image.Width;
            Height = image.Image.Height;

            // allocate the memory for the internal image
            internalImage = new byte[Width * Height * 4];

            Pitch = Width * 4;
            image.LockImage();
            image.Copy_to_Array(ref internalImage, ColorChannels.RGBA);
            image.UnLockImage();
        }
示例#2
0
        public void UpdateInternalImage(FxImages image)
        {
            int size = Width * Height;
            image.LockImage();
            image.Copy_to_Array(ref internalImage, ColorChannels.RGBA);
            image.UnLockImage();

            // write to the specific bitmap not create a new one
            mImageBitmap.CopyFromMemory(internalImage, Pitch);
        }