microsoft.public.dotnet.languages.vb - Microsoft .NET technology
uses statement: System.Windows.Forms.PictureBox pictureBox1; System.Windows.Forms.Panel panel1; pictureBox1 = new System.Windows.Forms.PictureBox(); panel1 = new System.Windows.Forms.Panel(); // // panel1 // panel1.BackColor = System.Drawing.Color.Transparent; panel1.Location = new System.Drawing.Point(40, 88); // // pictureBox1 // pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image"))); pictureBox1.Location = new System.Drawing.Point(16, 16); pictureBox1.Size = new System.Drawing.Size(248, 224); pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; pictureBox1.Controls.Add(panel1); PictureBox.Image is a GIF Animate,so should refresh panel1 in run ,how to don't.
I noticed that the .NET picturebox is a lot more memory intensive. I created an app ( VB.NET ) with a picturebox and loaded a test.bmp ( a 75mb bitmap image) when I run the app, the image loads quickly, but if I click on my form and drag it around the screen, it is very very choppy. I look at task manager and see that my memory keeps going up as I move my form I do the same test in VB6 using the VB6 picture box, and there is 0 delay when i move my form around the screen and my memory is stable. How do I get the same results in VB.NET using the picturebox ??
I have seen this successfully done in MFC, but can't get it to work in VB6 Classic. (Also want to get the idea working in VB.NET, but no flames please. Yes, we do know where the DotNet NG's are.) The concept is to have a PictureBox1, and then PictureBox2 lives - is inserted, inside PictureBox1. On LeftMouseButtonDown when dragging PictureBox2 around inside PictureBox1, I don't want PictureBox 2's top, bottom, right or left side to excceed the top, bottom, right or left of PictureBox1.(Inotherwords, I always want PictureBox2 to >always< stay, 100%, >inside< PictureBox1) Dragging is stopped either with releasing the mousebutton or when the cursor exceeds the bounds of PictureBox1. I have dragging stopping OK using GetCursorPos and POINTAPI through the API. when the cursor exceeds the top, bottom, right or left of PictureBox1, but the PictureBox2 bounds go outside the bounds of PictureBox1. Probably, for some doorknob simple reason, I can't figure out how to do it right. The above is dumbed down from project using LeadTools OCX for TWAIN graphics acquisition. PictureBox1 = Lead1. PictureBox2 = Lead2, which will be cropping area of Lead1. Have strip-mined Google, but can't seem to find anything appropriate. Anyone been there - done this or have any ideas? Sample gratefully appreciated. Pete
I have a PictureBoxB within another PictureBoxA. I write : PictureBoxB.move (PictureBoxA.Width - PictureBoxB.Width) / 2, _ (PictureBoxA.Height - PictureBoxB.Height) / 2 but I see that the PictureBoxB dont centered . Why this ?