Esempio n. 1
0
        private void SetupMegaTree(int degrees)
        {
            int stringCount = StringCount;

            if (stringCount < 2)
            {
                return;
            }
            preview.Data = new VixenPreviewData();
            preview.LoadBackground();
            preview.BackgroundAlpha = 0;
            displayItem             = new DisplayItem();
            PreviewMegaTree tree = new PreviewMegaTree(new PreviewPoint(10, 10), null, 1);

            tree.BaseHeight = 25;
            tree.TopHeight  = 1;
            tree.TopWidth   = 1;
            tree.StringType = PreviewBaseShape.StringTypes.Pixel;
            tree.Degrees    = degrees;

            tree.StringCount = stringCount;

            tree.PixelCount    = PixelsPerString();
            tree.PixelSize     = Data.PixelSize;
            tree.PixelColor    = Color.White;
            tree.Top           = 10;
            tree.Left          = 10;
            tree.BottomRight.X = preview.Width - 10;
            tree.BottomRight.Y = preview.Height - 10;
            tree.Layout();
            displayItem.Shape = tree;

            preview.AddDisplayItem(displayItem);
        }
Esempio n. 2
0
        private void timerRender_Tick(object sender, EventArgs e)
        {
            effect.RenderNextEffect(Data.CurrentEffect);
            int stringCount = StringCount;

            if (displayItem != null && displayItem.Shape != null)
            {
                if (displayItem.Shape is PreviewMegaTree)
                {
                    PreviewMegaTree tree = displayItem.Shape as PreviewMegaTree;
                    for (int stringNum = 0; stringNum < stringCount; stringNum++)
                    {
                        PreviewBaseShape treeString = tree._strings[stringNum];
                        for (int pixelNum = 0; pixelNum < treeString.Pixels.Count; pixelNum++)
                        {
                            treeString.Pixels[pixelNum].PixelColor = effect.Pixels[stringNum][pixelNum];
                        }
                    }
                }
                if (displayItem.Shape is PreviewPixelGrid)
                {
                    PreviewPixelGrid grid = displayItem.Shape as PreviewPixelGrid;
                    for (int stringNum = 0; stringNum < stringCount; stringNum++)
                    {
                        PreviewBaseShape gridString = grid._strings[stringNum];
                        for (int pixelNum = 0; pixelNum < gridString.Pixels.Count; pixelNum++)
                        {
                            gridString.Pixels[pixelNum].PixelColor = effect.Pixels[stringNum][pixelNum];
                        }
                    }
                }
                else if (displayItem.Shape is PreviewArch)
                {
                    PreviewArch arch = displayItem.Shape as PreviewArch;
                    for (int pixelNum = 0; pixelNum < arch.PixelCount; pixelNum++)
                    {
                        arch.Pixels[pixelNum].PixelColor = effect.Pixels[0][pixelNum];
                    }
                }
                else if (displayItem.Shape is PreviewLine)
                {
                    PreviewLine line = displayItem.Shape as PreviewLine;
                    for (int pixelNum = 0; pixelNum < line.PixelCount; pixelNum++)
                    {
                        line.Pixels[pixelNum].PixelColor = effect.Pixels[0][pixelNum];
                    }
                }
            }
            preview.RenderInForeground();
        }