picturebox

Make white background transparent png matlab

拥有回忆 提交于 2020-03-03 03:07:35
问题 I am trying to remove the white background on my png picture I get from a code I created. This is the picture I get: I want to make the white background transparent, because I have several of those images that I want to combine using imfuse. What I do is this (my picture is called 'A1.png'): A1=imread('A1.png'); D=zeros(size(A1)); D(A1==255) =1; imwrite(A1,'A11.png','alpha',D); However I get an error like this Error using writepng>parseInputs (line 349) The value of 'alpha' is invalid.

Make white background transparent png matlab

岁酱吖の 提交于 2020-03-03 03:05:48
问题 I am trying to remove the white background on my png picture I get from a code I created. This is the picture I get: I want to make the white background transparent, because I have several of those images that I want to combine using imfuse. What I do is this (my picture is called 'A1.png'): A1=imread('A1.png'); D=zeros(size(A1)); D(A1==255) =1; imwrite(A1,'A11.png','alpha',D); However I get an error like this Error using writepng>parseInputs (line 349) The value of 'alpha' is invalid.

How to change the border color of a picturebox (winform)?

左心房为你撑大大i 提交于 2020-02-23 09:51:29
问题 I want to set the border color/style around the picturebox on and off according to different events. Are there properties or functions that help me to achieve that aim? 回答1: Winforms doesn't let you change the border color of controls, they are fixed by the theme selected by the user. The easiest way to get what you want that doesn't require writing your own control is to put the picture box inside of a Panel, making it slightly smaller. Then just change the BackColor of the panel. The

Is it possible to have two overlapping PictureBox controls with transparent images? [duplicate]

别等时光非礼了梦想. 提交于 2020-02-18 07:51:20
问题 This question already has answers here : Transparent images with C# WinForms (6 answers) Closed 6 years ago . Having two overlapping PictureBox controls, I'm trying to make the transparent areas of the picture box let the controls below (in the z-order) being visible. Even after trying what Microsoft suggests, I cannot get the desired result. This is what I currently have: And this is what I want: So my question is: Any way to achieve my desired result with two PictureBox controls (or with

Is it possible to have two overlapping PictureBox controls with transparent images? [duplicate]

廉价感情. 提交于 2020-02-18 07:50:16
问题 This question already has answers here : Transparent images with C# WinForms (6 answers) Closed 6 years ago . Having two overlapping PictureBox controls, I'm trying to make the transparent areas of the picture box let the controls below (in the z-order) being visible. Even after trying what Microsoft suggests, I cannot get the desired result. This is what I currently have: And this is what I want: So my question is: Any way to achieve my desired result with two PictureBox controls (or with

Draw lines on a PictureBox

烈酒焚心 提交于 2020-02-02 04:08:13
问题 My question is related to Stack Overflow question Draw lines on a picturebox using mouse clicks in C# , but when the mouse button is up, the drawn line disappears. How do I fix this? private void GainBox_MouseDn(object sender, MouseEventArgs e) { mouse_dn = true; } private void GainBox_MouseMv(object sender, MouseEventArgs e) { //Line drawn from lookup table if (mouse_dn) { img = new Bitmap(256, 256); //Get the coordinates (x, y) for line from lookup table. for (x = x1; x < x2; x++) img

Cut an Image into 9 pieces C# [duplicate]

别说谁变了你拦得住时间么 提交于 2020-01-21 01:41:19
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: Image splitting into 9 pieces Though I googled enough but unfortunately failed to find a help. This Code Project Tutorial also failed to serve me what I actually need. I have an Image and 9 PictureBox(s) in a WinForm. Image img = Image.FromFile("media\\a.png"); // a.png has 312X312 width and height // some code help, to get // img1, img2, img3, img4, img5, img6, img7, img8, img9 // having equal width and

Remove PictureBox after time

ぃ、小莉子 提交于 2020-01-16 08:41:09
问题 I'm making simple game where I need to remove pictures after certain time without freezing everything else. I'm making explode event: private void Explode(int x, int y) { PictureBox explosion = new PictureBox(); explosion.Image = Properties.Resources.explosion; explosion.SizeMode = PictureBoxSizeMode.StretchImage; explosion.Size = new Size(50, 50); explosion.Tag = "explosion"; explosion.Left = x; explosion.Top = y; this.Controls.Add(explosion); explosion.BringToFront(); } I have already one

PictureBoxSizeMode.Zoom - What's the zoom factor?

醉酒当歌 提交于 2020-01-15 11:24:53
问题 I have a PictureBox (its SizeMode property set to Zoom) containing an image, and both may vary in size. Since the user has to interact with the image directly, I need to be able to convert the PictureBox click coordinates to image coordinates. What I have done so far, is compare the aspect ratio of the PictureBox to the aspect ratio of the image. For example, if the PictureBox is "more widescreen" in relation to the image (see screenshot), it means the PictureBox will stretch the image to its

Popping up a TextBox on mouse click over a PictureBox for adding custom note to picture

隐身守侯 提交于 2020-01-14 04:24:05
问题 In my C# winforms application, I have a picturebox which some bitmap images can be loaded into it. What I want to do is if user clicks somewhere within picturebox, at the mouse location a small textbox will be appeared and user can add a custom text (note) to the picture. I know how to write a string into a bitmap file, but I couldnt find a way to POP UP a textbox at mouse location, and automaticly add the text to the image when user wrote something and hit enter key. How this textbox and its