473,769 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image Zoom

I'm a newbie and i'm doing a little application that open image. I don't
understand what i've to do to have a zoom of an image...i don't know where's
the error. If anyone know a simple code tell me the url :O)
private void Zoom200_Click(o bject sender, System.EventArg s e)

{

PictureBox.Widt h = PictureBox.Widt h + (PictureBox.Wid th * 2);

PictureBox.Heig ht = PictureBox.Heig ht + (PictureBox.Hei ght * 2);

Ridisegna();

}


private void Ridisegna(){

PictureBox.Size Mode = PictureBoxSizeM ode.StretchImag e;

if ((PictureBox.Im age.Height>= PictureBox.Heig ht )||(PictureBox. Image.Width
= PictureBox.Widt h)){


vScrollBar.Maxi mum = PictureBox.Heig ht + hScrollBar.Heig ht;

hScrollBar.Maxi mum = PictureBox.Widt h + vScrollBar.Widt h;

hScrollBar.Valu e = 0;

vScrollBar.Visi ble = true;

hScrollBar.Visi ble = true;}

else{
vScrollBar.Visi ble = false;

hScrollBar.Visi ble = false; }

The error is that i don't see horizontal and vertical bar when the image is
bigger than picturebox
Nov 17 '05 #1
1 12800
Try putting the PictureBox control into a Panel and set the Panels
AutoScroll property to true. Now, the scrollbars should be added to the
Panel automatically when the PictureBox is larger than the Panel.

--
Tim Wilson
..Net Compact Framework MVP

"marco" <ma***@discussi ons.microsoft.c om> wrote in message
news:72******** *************** ***********@mic rosoft.com...
I'm a newbie and i'm doing a little application that open image. I don't
understand what i've to do to have a zoom of an image...i don't know where's the error. If anyone know a simple code tell me the url :O)
private void Zoom200_Click(o bject sender, System.EventArg s e)

{

PictureBox.Widt h = PictureBox.Widt h + (PictureBox.Wid th * 2);

PictureBox.Heig ht = PictureBox.Heig ht + (PictureBox.Hei ght * 2);

Ridisegna();

}


private void Ridisegna(){

PictureBox.Size Mode = PictureBoxSizeM ode.StretchImag e;

if ((PictureBox.Im age.Height>= PictureBox.Heig ht )||(PictureBox. Image.Width
= PictureBox.Widt h)){


vScrollBar.Maxi mum = PictureBox.Heig ht + hScrollBar.Heig ht;

hScrollBar.Maxi mum = PictureBox.Widt h + vScrollBar.Widt h;

hScrollBar.Valu e = 0;

vScrollBar.Visi ble = true;

hScrollBar.Visi ble = true;}

else{
vScrollBar.Visi ble = false;

hScrollBar.Visi ble = false; }

The error is that i don't see horizontal and vertical bar when the image

is bigger than picturebox

Nov 17 '05 #2

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

Similar topics

1
2650
by: John L | last post by:
Thanks in advance... I have an image control into which I load a .tif image, which loads fine... And when I select a rectangle to zoom down to , and click on a cmdButton ("ZOOM IN"), I zoom to selected rectangle as I expected, BUT ONLY when I run from within the .vbp. The cmdButton code is a 1 liner, namely: Me.imgMain.ZoomToSelection... If I create an executable, and perform the same thing, the image flashes once, showing me that the...
4
2036
by: Troy | last post by:
Hi all, Im a little new to ASP.NET. I'm looking to create an image viewer that zooms in, pretty common. But I need to draw a box on the 1:1 scale image and 'zoom in' on another picture box. The box outlining the zoom area would change in size according to the level of zoom of course. The help I need is how to get the target box to appear over the 1:1 scale image. I want it to be able to be dragged to a new location in the full
6
22395
by: Rich | last post by:
Hello, I am putting together a simple picture viewing program to view jpg. bmp pictures. I have the picturebox sizemode set to autosize. I have the picturebox in a pannel set to autoscroll, so if I get a picture that is larger than the width/height of the containing form (pannel, etc) I can scroll. But some of the pictures are like 5 megapixels and are just way too large for the screen. When I open this pic in Microsoft Photo Editor...
3
4751
by: Keith G Hicks | last post by:
In MS Access image controls there's a property setting for "Size Mode" --> Clip, Zoom or Stretch. I don't see any similar property in an asp image control. When I have an image on a page, it seems to Stretch no matter what. If an image is displayed that has different proportions than the image control itself, the image is distorted. I need a "Zoom" setting (not to zoom in and out). How can this be done? Thanks, Keith
9
3378
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the image that need manipulating is places on the server. dont need js for that ;-) 2. the client has the oppotunity to manipulate the image. cut and zoom. 3. the image i saved on the server.
2
7838
by: Dravid | last post by:
Hello, I am putting together a simple picture viewing program to view jpg pictures. I have the picturebox autosize set to true. I dont have the picturebox in a pannel set to autoscroll, so if I get a picture that is larger than the width/height of the containing form (pannel, etc) I can't able to scroll. When I open this pic in Microsoft Photo Editor - it opens to 50% zoom by default. How can I set the zoom in my picturebox which is...
7
17058
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir = "photo/thumbs/"; // Path To Thumbnails Directory $twidth = "125"; // Maximum Width For Thumbnail Images
10
7076
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for only small sized iamages.. for eg. resizing takes place for 70 kb sized images but fails for 600kb or more.. my code is below..
10
2648
by: Arnaud Diederen | last post by:
Hello everyone, and happy new year to all c.l.j'ers! No bad code to post, just a question. I wrote a JavaScript application that lets users view an image, and zoom on it. The way I "zoom" is pretty simple, really (I hope that your newsreaders displays text with a monospace font..) :
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.