Zoom Picturebox to the center of the cursor location


HOME ยป VB & VBnet

I'm trying to zoom in on a Picturebox when scrolling the
mousewheel, the code below zooms in on the image only to the center of
the image, not at the current cursor position. How would I fix
this?

PictureBox1.Size = New
System.Drawing.Size(PictureBox1.Width + e.Delta / 1,
PictureBox1.Height + e.Delta / 1)PictureBox1.Location = New
Point(Control.MousePosition.X - PictureBox1.Width / 2,
Control.MousePosition.Y - PictureBox1.Height / 2)

Hi all,

I want to display a picture by moving the mouse
cursor on a label or picturebox without clicking on them... How can I
do that?

PS: The picture would be big sized.

Regards, />wookinhung -VB noobie-

Development

I have a project on image processing. I have a picturebox with an
image loaded in it via a openfiledialog box.

I was trying to
zoom an image in the picturebox by certain pecentage i.e 50%, 100%
150% and 200% . All this is done when a user clicks on a menutool
strip option.

I have the following code but it is not
working:

private void toolStripMenuItem2_Click(object
sender, EventArgs e) //coding for 50% zoom { if
(img != null) { Graphics g =
Graphics.FromImage(img); int zoom=50/100; int
newwidth = Convert.ToInt32(pictureBox1.Width * zoom); int
newheight = Convert.ToInt32(pictureBox1.Hei
Development

![Hi Daniweb forum, I've come across a problem in my
panel_mousedown event. Now I initially have 3 pictureboxes Painted on
panel1, and each picturebox Control is set to Visible = false; and
only become visible again when using this code:

class="language-cs">private void panel1_MouseDown(object sender,
MouseEventArgs e) { if
(picturebox1.Bounds.Contains(e.Location) &&
!picturebox1.Visible) { picturebox1.Show();
picturebox2.Hide(); picturebox3.Hide();
} if (picturebox2.Bounds.Contains(e.Location)
&& !picturebox2.Visible) {
picturebox1
Development

Hi
I am currently working on a piece of code that I am
struggling to get working.
I have a picture box that I want to
move across the screen. At the moment I want it to stop when it gets
to a certain point and you have to click next to move it on to the
next point.
I have got the first stage to work but the thing that
i can't seem to get to work is getting the picture box to move any
further. It just stops there
I was wondering if anyone knew how
to get it to work.

Public Class Form1
Dim nextcommand As Integer = 7 Dim rewindcommand As Integer = 7
Dim x As Integer = 144 Dim y As Integer = 44 Private Sub
NextButton_C
VB & VBnet

I'm trying to zoom in on a Picturebox when scrolling the
mousewheel, the code below zooms in on the image only to the center of
the image, not at the current cursor position. How would I fix
this?

PictureBox1.Size = New
System.Drawing.Size(PictureBox1.Width + e.Delta / 1,
PictureBox1.Height + e.Delta / 1)PictureBox1.Location = New
Point(Control.MousePosition.X - PictureBox1.Width / 2,
Control.MousePosition.Y - PictureBox1.Height / 2)
VB & VBnet

I am a beginner looking for a simple example of zooming (in and
out) from the mousewheel an image placed in a picturebox (in C++).
All I have found are C# based applications but I don't know how to
adapt them in C++ (don't know C#).
Can you help me with a simple windows form aplication in c++ which
zooms the image from the mousewheel?

Web Development

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow