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(); }
private void SetupArch() { preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewArch arch = new PreviewArch(new PreviewPoint(10, 10), null, 1); arch.PixelCount = PixelsPerString(); arch.PixelSize = Data.PixelSize; arch.PixelColor = Color.White; arch.TopLeft = new Point(10, preview.Height / 2); arch.BottomRight = new Point((int)(preview.Width - 10), (int)(preview.Height - 10)); arch.Layout(); displayItem.Shape = arch; preview.AddDisplayItem(displayItem); }