public override void ChangeScale(float scale) { this.scale = scale; oldLocation = Location; ChangeControlSize(originSize); Scale(new SizeF(scale, scale)); pictureBox1.Image = ImageBlend.ResizeImage(pictureBox1.Image, Width, Height); Location = oldLocation; }
public override void ColorImagesToPanelColor() { //pictureBox1.Image = new Bitmap(activeImage); pictureBox1.Image = ImageBlend.ResizeImage(ImageBlend.MergeWithPanel(parentTabPage.GetDesktopPanel(), new Bitmap(activeImage), new Point(Location.X + parentTabPage.GetDesktopPanel().AutoScrollPosition.X, Location.Y + parentTabPage.GetDesktopPanel().AutoScrollPosition.Y)), Width, Height); if (overlayEnabled) { pictureBox2.Image = new Bitmap(overlayImage); ImageBlend.Blend(pictureBox1.Image, pictureBox2.Image); } }
private void CombineDrawingsWithElements() { //save foreach (Control c in parentTabPage.GetDesktopPanel().Controls) { if (c.GetType() == typeof(Label) || c.GetType() == typeof(InnerHeader)) { continue; } if (c.GetType() == typeof(InnerBitmap)) { InnerBitmap innerBitmap = (InnerBitmap)c; ((PictureBox)innerBitmap.Controls[0]).Image = ImageBlend.MergeWithPanel(parentTabPage.GetDesktopPanel(), new Bitmap(((PictureBox)innerBitmap.Controls[0]).Image), new Point(c.Location.X + parentTabPage.GetDesktopPanel().AutoScrollPosition.X, c.Location.Y + parentTabPage.GetDesktopPanel().AutoScrollPosition.Y)); foreach (Control c2 in parentTabPage.GetDesktopPanel().Controls) { if (c2.GetType() != typeof(Scale)) { continue; } Scale scale = (Scale)c2; if (innerBitmap.elementName == scale.elementName) { continue; } if (scale.Location == innerBitmap.Location) { Image front = null; foreach (Control c3 in scale.Controls) { if (c3.GetType() != typeof(PictureBox)) { continue; } if (c3.Name == "pictureBox1") { front = ((PictureBox)c3).Image; } } Image back = innerBitmap.activeImage; back = ImageBlend.ResizeImage(back, (int)(back.Width * scale.scale), (int)(back.Height * scale.scale)); //ImageBlend.Blend(back, front); scale.ApplyMask(new Bitmap(back)); } } } } parentTabPage.GetDesktopPanel().Refresh(); }
public override void ChangeScale(float scale) { this.scale = scale; oldLocation = Location; ChangeControlSize(originSize); Scale(new SizeF(scale, scale)); pictureBox1.Image = ImageBlend.ResizeImage(pictureBox1.Image, Width, Height); pictureBox2.Size = overlayImage.Size; if (overlayEnabled) { overlayScale *= scale; pictureBox2.Scale(new SizeF(overlayScale, overlayScale)); pictureBox2.Image = ImageBlend.ResizeImage(pictureBox2.Image, pictureBox2.Width, pictureBox2.Height); } Location = oldLocation; }
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); }