//AboutBox aboutForm = new AboutBox(); #endregion //-------------------------------- #endregion //========= CONSTRUCTORS ========= #region Constructors /** <summary> Constructs the form. </summary> */ public GroupForm(string[] args) { InitializeComponent(); Pathing.SetPathSprites(); Water.LoadResources(); ColorRemapping.LoadResources(); Terrain.LoadResources(); this.fontBold = new SpriteFont(Resources.BoldFont, ' ', 'z', 10); this.drawSettings.Remap1 = RemapColors.IndianRed; this.drawSettings.Remap2 = RemapColors.Gold; this.drawSettings.Remap3 = RemapColors.Bark; this.drawSettings.Slope = -1; this.labelCurrentObject.Text = ""; this.objectImage = new Bitmap(190, 254); this.LoadSettings(null, null); //this.directory = this.defaultDirectory; this.sceneryGroup = new SceneryGroup(); this.sceneryGroup = (SceneryGroup)ObjectData.FromBuffer(Resources.SCGCUST); this.sceneryGroup.ObjectHeader.Flags = 0x7; LoadSceneryGroup(); }
//-------------------------------- #endregion //========= CONSTRUCTORS ========= #region Constructors /** <summary> Constructs the form. </summary> */ public AudioForm() { InitializeComponent(); Pathing.SetPathSprites(); Water.LoadResources(); Terrain.LoadResources(); ColorRemapping.LoadResources(); this.dataDirectory = ""; string[] possibleDirectories = { "%PROGRAMFILES%\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES%\\Infogrames\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES%\\Atari\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Infogrames\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Atari\\Rollercoaster Tycoon 2\\ObjData", "%USERPROFILE%\\Desktop" }; for (int i = 0; i < possibleDirectories.Length; i++) { if (Directory.Exists(Environment.ExpandEnvironmentVariables(possibleDirectories[i]))) { this.dataDirectory = Environment.ExpandEnvironmentVariables(possibleDirectories[i]); break; } } this.LoadSettings(null, null); }
private void camCtl_OverlayUpdate(object sender, ICImagingControl.OverlayUpdateEventArgs e) { if (camCtl.DeviceValid) { var ob = e.overlay; ob.Fill(ob.DropOutColor); if (btnFocus.Checked) { var buffer = camCtl.ImageActiveBuffer; Bitmap bmp = new Bitmap(buffer.Bitmap); bmp = Grayscale.CommonAlgorithms.RMY.Apply(bmp); FiltersSequence filters = new FiltersSequence { new DifferenceEdgeDetector(), new Threshold(threshold), new Dilatation3x3() }; bmp = filters.Apply(bmp); ColorRemapping remapping = new ColorRemapping { RedMap = new byte[256], GreenMap = new byte[256], BlueMap = new byte[256] }; remapping.RedMap[255] = 255; Bitmap overlay = new Bitmap(bmp.Width, bmp.Height, PixelFormat.Format24bppRgb); using (Graphics gr = Graphics.FromImage(overlay)) { gr.DrawImage(bmp, 0, 0); gr.Save(); gr.Dispose(); } overlay = remapping.Apply(overlay); var g = ob.GetGraphics(); g.DrawImage(overlay, 0, 0); ob.ReleaseGraphics(g); } DrawCoordinatesystem(ob, Color.Aqua, false); } }
//-------------------------------- #endregion //========= CONSTRUCTORS ========= #region Constructors /** <summary> Constructs the form. </summary> */ public MusicForm() { InitializeComponent(); Pathing.SetPathSprites(); Water.LoadResources(); Terrain.LoadResources(); ColorRemapping.LoadResources(); this.fontBold = new SpriteFont(Resources.BoldFont, ' ', 'z', 10); this.dataDirectory = ""; string[] possibleDirectories = { "%PROGRAMFILES%\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES%\\Infogrames\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES%\\Atari\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Steam\\steamapps\\common\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Infogrames\\Rollercoaster Tycoon 2\\ObjData", "%PROGRAMFILES(x86)%\\Atari\\Rollercoaster Tycoon 2\\ObjData", "%USERPROFILE%\\Desktop" }; for (int i = 0; i < possibleDirectories.Length; i++) { if (Directory.Exists(Environment.ExpandEnvironmentVariables(possibleDirectories[i]))) { this.dataDirectory = Environment.ExpandEnvironmentVariables(possibleDirectories[i]); break; } } this.LoadSettings(null, null); this.LoadSongs(null, null); if (!Directory.Exists(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Custom Music"))) { Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Custom Music")); } if (!Directory.Exists(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Custom Music", "Modified"))) { Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Custom Music", "Modified")); } }
public override void consumeMessage(IMessage message, int msgID) { VisionMessage vm = message as VisionMessage; // Bitmap bitmap = ByteTools.BytesToBmp(vm.Bitmap, vm.BmpWidth, vm.BmpHeight, ByteTools.bppToPixelFormat(vm.BytePerPixel)); Bitmap bitmap = vm.Bitmap; Bitmap rgb = bitmap; bitmap = new ColorRemapping(redMap, greenMap, blueMap).Apply(bitmap); bitmap = new GrayscaleBT709().Apply(bitmap); bitmap = new Threshold(32).Apply(bitmap); //rgb = new GrayscaleToRGB().Apply(bitmap); Graphics g = Graphics.FromImage(rgb); if (g == null) { Console.WriteLine("Null Graphics!"); return; } if (!threadRunning) { threadRunning = true; for (int i = 0; i < 3; i++) { if (g != null && currentStateProbs[i] > double.MinValue) { drawLine(g, new HoughLine((double)currentThetaStates[i], (short)currentRStates[i], 0, 0d), new Rectangle(0, heightRes[0], bitmap.Width, (heightRes[heightRes.Length - 1] - heightRes[0]) * 2)); } } ThreadStart starter = delegate { findLines(bitmap); }; Thread innerThread = new Thread(starter); innerThread.Start(); } vm = new VisionMessage(rgb.Height, rgb.Width, ByteTools.pixelFormatToBPP(rgb.PixelFormat), rgb); msgService.sendMsg(vm); }