473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to create a zoom feature in Vb.Net

How do I write code to include a zoom feature in my project so that when my Vb Form loads an image I can click in my main menu zoom in or zoom out?

--------------------------------
From: Mo Ade

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>6aW7IUJA+0CCEGJ4S8DRuA==</Id>
Nov 21 '05 #1
2 12646
Hi,

I haven't got a complete answer for you but this should help:

Dim b As System.Drawing.Bitmap
b = New System.Drawing.Bitmap(newWidth, newHeight)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(b)
g.InterpolationMode =
Drawing.Drawing2D.InterpolationMode.HighQualityBil inear
g.DrawImage(PictureBox1.Image, New System.Drawing.Rectangle(0, 0, b.Width,
b.Height), 0, 0, PictureBox1.Image.Width, PictureBox1.Image.Height,
Drawing.GraphicsUnit.Pixel)
g.Dispose()

with the g.drawimage you can draw a piece of an image or a complete image on
a bigger or smaller bitmap/image hence zoom in/out but you'll have to
experiment with it to achieve what you want. Or maybe someone alse has got a
complete sample which you can use, I haven't got the time to make one now
because I'm to busy at work. And maybe someone else has got a better
solution.

hth Peter

"Mo Ade via .NET 247" <an*******@dotnet247.com> schreef in bericht
news:et**************@TK2MSFTNGP15.phx.gbl...
How do I write code to include a zoom feature in my project so that when my Vb Form loads an image I can click in my main menu zoom in or zoom out?
--------------------------------
From: Mo Ade

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>6aW7IUJA+0CCEGJ4S8DRuA==</Id>

Nov 21 '05 #2
Mo Ade via .NET 247 wrote:
How do I write code to include a zoom
feature in my project so that when my
Vb Form loads an image I can click in
my main menu zoom in or zoom out?


If you are open to using a commercial component
in your VB.NET project, our MetaDraw component
will allow both Zoom and Scroll. You can specify
zoom by some ratio simply by writing

MetaDraw.ZoomFactor = XXXX
( where X is multiple or fraction of original size)

You can also let user create a zoom rectangle
Just set
MetaDraw.EditMode = ED_Zoom
and user can draw zoom rectangle with mouse
and the image will be zoomed to show that area.

You can even allow user to zoom simply by holding
the CNTL key and using the Scroll Wheel of a mouse

MetaDraw.ScrollMouse = ScrollType.WheelZoom
OR MetaDraw.ScrollMouse

Also if you like when you are ready to print you
can zoom the printout, or print only some desired
portion of the image.

Take a look at www.Bennet-Tec.com and select MetaDraw.

I'd be happy to answer any questions you might
have about this
* * Please include a copy of this message with your reply

Jeff Bennett
Jeff @ Bennet-Tec.Com

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Phelps | last post by:
My problem is as follows: I need automatically iterate through a single field in a table and use the values in the field to create an in-statement. Currently, the character limitation in the...
2
by: ACaunter | last post by:
Hi there, I have a bunch of images on my ASP.Net website, and i wanted to have a zoom feature as well..., I can do it with panels and just keep doing the image.width = image.width * 2... but i...
1
by: JasonL | last post by:
How do I create a map in VB.net where user can "drag" it using their stylus as the map size is big and how to create a zoom in , zoom out function for it? I would like to do something similar to...
1
by: VB Programmer | last post by:
Any idea how to do this zoom in/out, move, feature: http://www.anthropologie.com/shopping/product/product_detail_zooms.jsp?productID=11553&tabID=3&view=frt I want to incorporate this onto one...
9
by: patrick j | last post by:
Hi I've just discovered that IE 7 messes up horizontal lists. I've done a bit of searching the web but a solution has not sprung forth from this searching. Below is a url with a horizontal...
2
by: IanTrent | last post by:
On my website, I have an absolute positioned menu that moves with the page when the user scrolls. It determines its place on the page by referencing document.body.clientHeight or...
4
by: paulcybulski | last post by:
Hi I would like to apply a zoom feature where the user can scroll the mouse wheel to zoom in and out on a movieclip. I currently have zoom implemented as buttons. How would I go about implementing...
1
by: Sunny | last post by:
Hi, IE7 has a zoom feature.(In IE7, If you look at lower Right Corner, there is a button that let you set the zoom level of ur webpage. the default is 100%.) The problem is I am drawing vml...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.