Beispiel #1
0
        private static void Clock_Tick(object sender, EventArgs e)
        {
            if (drawing && penUp)
            {
                if (count > 5)
                {
                    ActiveBrush.End();

                    ResetDrawArea();
                    count = 0;
                }
                count++;
            }

            if (!drawing && SelectersLayerMode)
            {
                if (colorState)
                {
                    colorBalance += 0.02;
                    if (colorBalance >= 1.0)
                    {
                        colorState = false;
                    }
                }
                else
                {
                    colorBalance -= 0.02;
                    if (colorBalance <= 0.0)
                    {
                        colorState = true;
                    }
                }

                DynamicRender.OverrayColor[0] = (float)(color1.r * colorBalance + color2.r * (1.0 - colorBalance)) / 255.0f;
                DynamicRender.OverrayColor[1] = (float)(color1.g * colorBalance + color2.g * (1.0 - colorBalance)) / 255.0f;
                DynamicRender.OverrayColor[2] = (float)(color1.b * colorBalance + color2.b * (1.0 - colorBalance)) / 255.0f;
                DynamicRender.OverrayColor[3] = 0.6f;

                if (currentCanvas != null)
                {
                    currentCanvas.glControl.Refresh();
                }
            }

            if (waitingImage != null)
            {
                waitingImage.TextureUpdate();
                waitingImage = null;

                if (currentCanvas != null)
                {
                    currentCanvas.glControl.Refresh();
                }
            }
        }
Beispiel #2
0
        public SingleColorImage(byte b, byte g, byte r, byte a)
        {
            LayerType = ImageTypes.SingleColor;
            PixelData color = new PixelData()
            {
                b = b,
                g = g,
                r = r,
                a = a
            };

            Color     = color;
            imageData = new BGRA32FormattedImage(1, 1);
            imageData.ClearData(Color);
            imageData.TextureUpdate();
            PropertyChanged += SingleColorImage_PropertyChanged;
        }
Beispiel #3
0
 protected void EntryTexUpdate(BGRA32FormattedImage image)
 {
     waitingImage = image;
 }