public PluginForm()
        {
            this.InitializeComponent();
            pForm = this;
            this.cbDomains.SelectedIndexChanged += new EventHandler(this.CbDomains_SelectedIndexChanged);
            this.sliderOffset.ValueChanged      += new Action <object, EventArgs>(this.SliderOffset_ValueChanged);
            this.sliderDelay.ValueChanged       += new Action <object, EventArgs>(this.SliderDelay_ValueChanged);
            this.sliderOffset.ValueCorrection    = new Func <long, long>(this.SliderOffsetCorrection);
            this.FormClosing += new FormClosingEventHandler(this.MemoryVisualizer_FormClosing);

            //Pixel formats
            string[] names = PixFormats.GetNames();
            this.display.curFormat = PixFormats.Get(names[0]);
            this.cbFormat.Items.AddRange(names);
            this.cbFormat.SelectedIndex         = 0;
            this.offsetIncr                     = display.curFormat.BytesWide;
            this.cbFormat.SelectedIndexChanged += new EventHandler(this.CbFormat_SelectedIndexChanged);

            //Context menu
            ContextMenu contextMenu = new ContextMenu();

            contextMenu.MenuItems.Add(new MenuItem("Copy Image", (o, e2) => { lock (executeLock) { ImageClipboard.SetClipboardImage(display.bitmap.Bitmap, null, null); } })); //TODO: PNG
            contextMenu.MenuItems.Add(new MenuItem("Copy Range", (o, e2) => { lock (executeLock) { Clipboard.SetText(this.rangeStartAddress.ToString("X") + "-" + this.rangeEndAddress.ToString("X")); } }));
            this.display.ContextMenu = contextMenu;

            //refreshDel = Delegate.CreateDelegate(typeof(Action), display, "Refresh");
            //Set loop
            StepActions.StepEnd += this.StepActions_StepEnd;

            this.Load += MemoryVisualizer_Load;

            this.labelVersion.Text = $"{PluginCore.Ver.ToString()}"; //automatic window title
        }
Exemplo n.º 2
0
 /// <summary>
 ///  Copies the given image to the clipboard as PNG, DIB and standard Bitmap format.
 /// </summary>
 /// <param name="image">Image to put on the clipboard.</param>
 /// <param name="imageNoTr">Optional specifically nontransparent version of the image to put on the clipboard.</param>
 /// <param name="tempFile">The path to a temporary file that can be pasted.</param>
 ///
 /// <exception cref="ArgumentNullException">
 ///  <paramref name="image"/> is null.
 /// </exception>
 public void SetImage(Bitmap image, Bitmap imageNoTr, string tempFile)
 {
     ImageClipboard.SetClipboardImage(image, imageNoTr, tempFile);
 }