// get private and public key from path ... public Form1() { _folderPath = "C:\\Users\\Gaël\\source\\repos\\PIXCHAIN\\firstchain\\bin\\Debug\\"; KeyPath = "C:\\Users\\Gaël\\source\\repos\\PIXCHAIN\\firstchain\\bin\\Debug\\Compte A\\"; if (!File.Exists(KeyPath + "publicKey")) { MessageBox.Show("keys are not in folder! Please Relaunch!"); return; } ulong mupoindex = PixelWrapper.GetUPOIndex(PixelWrapper.ComputeSHA256(File.ReadAllBytes(KeyPath + "publicKey"))); if (mupoindex == 0) { MessageBox.Show("Upo not found! Please Mine something and relaunch!"); return; } MYUPO = PixelWrapper.GetOfficialUPO_B(mupoindex); if (MYUPO == null) { MessageBox.Show("Upo not found! Please Mine something and relaunch!"); return; } InitializeComponent(); myUPOInfo.Text = PixelWrapper.SHAToHex(MYUPO.HashKey, false) + " | sold : " + MYUPO.Sold; g = Graphics.FromImage(myDraw); this.Controls.Add(drawBox); drawBox.Size = new Size(1000, 1000); drawBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MouseDown); drawBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MouseUp); drawBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Draw); this.KeyDown += KeyDownHandler; this.KeyUp += KeyUpHandler; Thread validationThread = new Thread(new ThreadStart(PixelWrapper.ValidatingThread)); validationThread.IsBackground = true; validationThread.Start(); }
private void AddPixel(double x, double y, double xScale, double yScale, ref Canvas _renderedImage, Ipixel _data, int _maxR, int _maxG, int _maxB) { PixelWrapper xrfPix = new PixelWrapper(_data, xScale, yScale); Canvas.SetTop(xrfPix.Graphic, y); Canvas.SetLeft(xrfPix.Graphic, x); xrfPix.Graphic.Fill = new SolidColorBrush(_generateColorAction(_data.Temperature, _maxR, _maxG, _maxB)); xrfPix.Graphic.MouseEnter += Graphic_MouseEnter; xrfPix.Graphic.MouseLeftButtonDown += Graphic_MouseLeftButtonDown; xrfPix.Graphic.MouseRightButtonDown += Graphic_MouseRightButtonDown; _renderedImage.Children.Add(xrfPix.Graphic); }