private void ApplyOverlayImage() { pictureBox2.Size = overlayImage.Size; pictureBox2.Image = new Bitmap(overlayImage); pictureBox2.Scale(new SizeF(overlayScale, overlayScale)); ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); }
internal void Apply(string name, int x, int y, float scale, string imageName, string overlayImageName, Point overlayOffset, float overlayScale, string clicker) { if (name != "") { elementName = name; } Location = new Point(x, y); ChangeScale(scale); this.imageName = imageName; string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\gui\" + imageName + ".png"; ApplyImage(path); this.overlayImageName = overlayImageName; path = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\gui\" + overlayImageName + ".png"; this.overlayScale = overlayScale; try { overlayImage = Bitmap.FromFile(path); } catch (Exception) { MessageBox.Show("Отсутствует файл " + path + ". Добавьте его и загрузите заново"); overlayImage = Resources._default_slot_empty; overlayImageName = "_default_slot_empty.png"; } overlayEnabled = true; pictureBox2.Visible = true; pictureBox2.Size = overlayImage.Size; pictureBox2.Image = new Bitmap(overlayImage); pictureBox2.Scale(new SizeF(overlayScale, overlayScale)); pictureBox2.Location = overlayOffset; ImageBlend.Blend(pictureBox1.Image, overlayImage); this.clicker = clicker; }
private void _overlaySizeValue_LostFocus(object sender, EventArgs e) { if (constant) { return; } if (!overlayEnabled) { return; } if (!overlayScaleTextChanged) { return; } overlayScaleTextChanged = false; TextBox textBox = (TextBox)sender; float scale; if (!float.TryParse(textBox.Text, System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out scale)) { textBox.Text = overlayScale.ToString(); return; } overlayScale = scale; pictureBox2.Scale(new SizeF(overlayScale, overlayScale)); if (overlayEnabled) { ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); } }
private void PictureBox2_VisibleChanged(object sender, EventArgs e) { if (overlayEnabled) { ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); } }
public override void ToDefault() { ActiveImage = _params.GetInvSlotImage(out string imageName); pictureBoxSlot.Image = new Bitmap(ActiveImage); ImageName = imageName; pictureBoxSelection.Image = new Bitmap(_params.GetSelectionImage(out imageName)); ImageBlend.Blend(pictureBoxSlot.Image, pictureBoxSelection.Image); Refresh(); }
public override void ColorImagesToPanelColor() { pictureBox1.Image = ImageBlend.MergeWithPanel(parentTabPage.GetDesktopPanel(), new Bitmap(activeImage), new Point(Location.X + parentTabPage.GetDesktopPanel().AutoScrollPosition.X, Location.Y + parentTabPage.GetDesktopPanel().AutoScrollPosition.Y)); if (overlayEnabled) { pictureBox2.Image = new Bitmap(overlayImage); ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); } }
internal void Apply(string name, int x, int y, float scale, string imageName, int side, bool invert, string overlayImageName, Point overlayOffset, float overlayScale, string clicker) { if (name != "") { elementName = name; } Location = new Point(x, y); ChangeScale(scale); this.imageName = imageName; string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\gui\" + imageName + ".png"; ApplyImage(path); pictureBox1.Image = ImageBlend.MergeWithPanel(parentTabPage.GetDesktopPanel(), new Bitmap(pictureBox1.Image), new Point(Location.X + parentTabPage.GetDesktopPanel().AutoScrollPosition.X, Location.Y + parentTabPage.GetDesktopPanel().AutoScrollPosition.Y)); this.overlayImageName = overlayImageName; path = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\gui\" + overlayImageName + ".png"; this.overlayScale = overlayScale; try { overlayImage = Bitmap.FromFile(path); } catch (ArgumentException) { MessageBox.Show("Отсутствует файл " + path + ". Добавьте его и загрузите заново"); overlayImage = Resources._default_slot_empty; overlayImageName = "_default_slot_empty.png"; } overlayEnabled = true; pictureBox2.Visible = true; pictureBox2.Size = overlayImage.Size; pictureBox2.Image = new Bitmap(overlayImage); pictureBox2.Scale(new SizeF(overlayScale, overlayScale)); pictureBox2.Location = overlayOffset; ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); chosenItem = side; this.invert = invert; Clicker = clicker; }
internal void SetSelection(Image selectionDefaultImage) { pictureBoxSelection.Image = new Bitmap(selectionDefaultImage); ImageBlend.Blend(pictureBoxSlot.Image, pictureBoxSelection.Image); Refresh(); }
public void ApplyMask(Bitmap image) { ImageBlend.MergeWithPanel(parentTabPage.GetDesktopPanel(), new Bitmap(image), new Point(Location.X + parentTabPage.GetDesktopPanel().AutoScrollPosition.X, Location.Y + parentTabPage.GetDesktopPanel().AutoScrollPosition.Y)); ImageBlend.Blend(image, activeImage); BackgroundImage = ImageBlend.ResizeImage(image, Width, Height); }