PC Review


Reply
Thread Tools Rate Thread

How to create a zoom feature in Vb.Net

 
 
Mo Ade via .NET 247
Guest
Posts: n/a
 
      6th Apr 2005
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>
 
Reply With Quote
 
 
 
 
Peter Proost
Guest
Posts: n/a
 
      6th Apr 2005
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.HighQualityBilinear
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" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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>



 
Reply With Quote
 
jeff@bennet-tec.com
Guest
Posts: n/a
 
      10th Apr 2005
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

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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
zoom feature tinks Microsoft Word Document Management 1 18th Sep 2008 03:23 PM
ZOOM IN and OUT feature rdbr Windows XP General 2 9th Jun 2008 01:41 AM
zoom in/zoom out feature =?Utf-8?B?c2hhbm5vbg==?= Microsoft Powerpoint 4 25th Jun 2006 03:18 AM
XP-IE Zoom feature? Bob Windows XP General 2 21st Dec 2005 06:37 AM
Zoom feature Aidan Microsoft Word Document Management 2 26th Mar 2004 10:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:41 AM.