picturebox

Is it possible to stretch picture in PictureBox without horizontal scrollbar and only Vertical scrollbar in WinForms?

廉价感情. 提交于 2019-12-12 07:05:06
问题 I have a PictureBox inside the Panel with picture box Dock = DockStyle.Fill . When I assign picture into the PictureBox , picture is stretch horizontal to fit the space available and need a vertical scrollbar to scroll the image. I do not need of horizontal scrollbar in it. Please do not make this question as duplicate.. I have clearly mentioned that I only need of vertical scrollbar with run time resizing option of the panel. Note: Panel size may change at run time (so, obviously PictureBox

Fill picturebox with multiple images and save it. C#

大城市里の小女人 提交于 2019-12-12 07:03:27
问题 I don't know how to fill picturebox with small loaded image multiple times and then save it. Picturebox has a size determined by user. Then I load the image and put it to picturebox as many times as possible with current size of picturebox. Any idea how to do that? Example bellow shows how it should look like (but here there is a background and i cant save this multiple images in one picture) PS. I can't place image because i don't have enough reputation:( 回答1: You add the image as the

Suggestion: Drag and Dropping Between PictureBoxes

戏子无情 提交于 2019-12-12 06:17:02
问题 I have included 2 images so you can understand my question easier, I could not link them directly in here as I am a new member, so I have put them in my Dropbox public folder, Image 1: Design View https://www.dropbox.com/s/wca5gstd8kdsie7/designView.png?dl=0 Here you can see a Group Panel on the left, With 6 smaller boxes nested they are all "pictureBoxes", Then on the right is a larger picture Box, with a smaller one nested inside, Image 2 Application Running https://www.dropbox.com/s

heart shaped picturebox

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:49:09
问题 Is it possible to make a heart shaped picturebox in c#? I have seen codes in making rectangle and ellipse but I don't have any idea on making a heart shaped region. Any idea? 回答1: This seems to work: public class HeartPictureBox : PictureBox { protected override void OnPaint(PaintEventArgs pe) { using (System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath()) { path.AddBezier(this.Width >> 1, this.Height >> 2, this.Width * 1.25f, 0f, this.Width, this.Height * 0

Graphics.RotateTransform() does not rotate my picture

冷暖自知 提交于 2019-12-12 03:49:00
问题 I have problem with Graphics.RotateTransfrom() with the following code : Dim newimage As Bitmap newimage = System.Drawing.Image.FromFile("C:\z.jpg") Dim gr As Graphics = Graphics.FromImage(newimage) Dim myFontLabels As New Font("Arial", 10) Dim myBrushLabels As New SolidBrush(Color.Black) Dim a As String '# last 2 number are X and Y coords. gr.DrawString(MaskedTextBox2.Text * 1000 + 250, myFontLabels, myBrushLabels, 1146, 240) gr.DrawString(MaskedTextBox2.Text * 1000, myFontLabels,

XNA.Texture2D to System.Drawing.Bitmap

僤鯓⒐⒋嵵緔 提交于 2019-12-12 03:48:35
问题 I need load XNA.Texture2D to PictureBox. i've tried this: http://www.gamedev.net/community/forums/viewreply.asp?ID=3224621 but it doesn't work. Any suggestions? 回答1: You should be able to use that method, but make sure that your XNA Texture2D is created with a format of 32bbpARGB. Any other format will prevent that method from working directly. 回答2: Easier way to do it is save the Texture2D using Texture2D.SaveAsPng or Texture2D.SaveAsJpeg to a memory stream and the open the virtual file

Where is the proper place to dispose an image

天大地大妈咪最大 提交于 2019-12-12 03:08:53
问题 I have a form with OpenFileDialog for selecting image and showing it in pictureBox . Until the form is open the user can open and then save the opened image as many times as he wants. What I want to do is, after each new selection-save, to delete the previously saved image if there is such. The problem is that as I implemented the code now I am able to delete the image the first time, if I keep on saving images with the currently open form I get an error that the resource is being used. What

Adding Picture from Excel to PictureBox but empty picture show up

懵懂的女人 提交于 2019-12-12 02:58:43
问题 i have a code that add a group of several pictures. Then my program ran well on Win7 with Office 2010 that picturebox can show picture. But, when my program ran in WinXP with office 2003. It can't show any picture. Does anyone know why? This is my code For Each sp As EXCEL.Shape In xlsheet.Shapes sp.Copy() picname = sp.Name If Strings.Left(picname, 5) = "Group" Then If Clipboard.ContainsImage Then MsgBox("have image") xlPic = Clipboard.GetImage PictureBox1.Image = xlPic ImageList1.Images.Add

vb.net Using the drag and drop operation using images

馋奶兔 提交于 2019-12-12 02:19:58
问题 I'm currently trying to simplify a tool that we use at work. For this I would like to use the drag and drop method. The tool is basically like building a tower using three different kind of blocks. At the top there are the three images of the different blocks below is a flow-layout-panel. The goal is to drag in a desired order the blocks into the flow-layout-panel. Here is a quick image that would represent the start position. (Just to be clear.) This for me is the tricky part. I only used

How do I catch an exception in a GUI thread?

时光怂恿深爱的人放手 提交于 2019-12-12 01:35:47
问题 An exception is thrown in a user control based on a picture box, causing it to show the typical error image (red X). Since the GUI thread caught and handled the exception itself, I cannot easily find out where the exception occurred and debug. I'm currently wrapping the whole OnPaint code in a try-catch, and was able to debug the code, but I found it quite tedious so I wondered if there is a way to break into debugger from a GUI thread exception. 回答1: It already works this way by default. The