Exemplo n.º 1
0
        private void SetupLine(bool horizontal)
        {
            preview.Data = new VixenPreviewData();
            preview.LoadBackground();
            preview.BackgroundAlpha = 0;
            displayItem             = new DisplayItem();
            PreviewPoint p1, p2;

            if (horizontal)
            {
                p1 = new PreviewPoint(10, preview.Height / 2);
                p2 = new PreviewPoint(preview.Width - 10, preview.Height / 2);
            }
            else
            {
                p1 = new PreviewPoint(preview.Width / 2, preview.Height - 10);
                p2 = new PreviewPoint(preview.Width / 2, 10);
            }
            PreviewLine line = new PreviewLine(p1, p2, PixelsPerString(), null, 1);

            line.PixelCount = PixelsPerString();
            line.PixelSize  = Data.PixelSize;
            line.PixelColor = Color.White;
            line.Layout();
            displayItem.Shape = line;

            preview.AddDisplayItem(displayItem);
        }
Exemplo 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();
        }
Exemplo n.º 3
0
 public PreviewLineManager(Grid grid, int gridSize)
 {
     PreviewLine = new PreviewLine(gridSize);
     grid.Children.Add(PreviewLine);
 }
Exemplo n.º 4
0
 void Start()
 {
     preview_line = GetComponentInChildren <PreviewLine>();
     preview_line.init();
 }