473,761 Members | 7,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Zoom/resize image in picturebox with sizemode set to autosize

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 - it
opens to 50% zoom by default. How can I set the zoom in my picturebox which
is set to autosize? How do I set the zoom? Like if I get the image size say
1900x800 I will automatically zoom the image to 50%. How do I set the zoom
of the image? I tried Img.Zoom, but there is no .Zoom.

Thanks,
Rich
Nov 21 '05 #1
6 22394
Maybe you can use the zoompicbox from bobpowell

http://www.bobpowell.net/zoompicbox.htm

Greetz Peter

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.

"Rich" <Ri**@discussio ns.microsoft.co m> schreef in bericht
news:8B******** *************** ***********@mic rosoft.com...
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 - it
opens to 50% zoom by default. How can I set the zoom in my picturebox which is set to autosize? How do I set the zoom? Like if I get the image size say 1900x800 I will automatically zoom the image to 50%. How do I set the zoom of the image? I tried Img.Zoom, but there is no .Zoom.

Thanks,
Rich

Nov 21 '05 #2
Rich,

I have this nowhere as sample. (I have it as part of a program, however in
to much methods to be able to cut it)

I thought that in the 101 samples there was somewhere showed how to do what
you ask)

http://msdn.microsoft.com/vbasic/dow...de/101samples/

Most samples are still for version 1.1

Don't be agry at me when it is not.

I hope this helps anyhow

Cor
Nov 21 '05 #3
Thanks all for your replies. I am still using VS2003. Would the examples
from the 101 samples site work with 2003? I will also try your example -
Peter.

Thanks again all,
Rich

"Rich" wrote:
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 - it
opens to 50% zoom by default. How can I set the zoom in my picturebox which
is set to autosize? How do I set the zoom? Like if I get the image size say
1900x800 I will automatically zoom the image to 50%. How do I set the zoom
of the image? I tried Img.Zoom, but there is no .Zoom.

Thanks,
Rich

Nov 21 '05 #4
Rich

This is what I wrote
Most samples are still for version 1.1


With what I mean Net 1.1 ergo Visual Studio 2003, you have to page to those
pages and than that is written somewhere

I hope this helps,

Cor
Nov 21 '05 #5
Thanks all for your replies. I am still using VS2003. Would the examples
from the 101 samples site work with 2003? I will also try your example -
Peter.

Thanks again all,
Rich

"Rich" wrote:
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 - it
opens to 50% zoom by default. How can I set the zoom in my picturebox which
is set to autosize? How do I set the zoom? Like if I get the image size say
1900x800 I will automatically zoom the image to 50%. How do I set the zoom
of the image? I tried Img.Zoom, but there is no .Zoom.

Thanks,
Rich

Nov 21 '05 #6
Rich

This is what I wrote
Most samples are still for version 1.1


With what I mean Net 1.1 ergo Visual Studio 2003, you have to page to those
pages and than that is written somewhere

I hope this helps,

Cor
Nov 21 '05 #7

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

Similar topics

3
1954
by: Li Weng | last post by:
Hi, I have a form with a picturebox. I added an image in picturebox at design time. I create the form in codes with New and .Show() to pop up. But image doesn't show up. The picturebox looks transparent. Please help. Thanks in advance. Li
3
13374
by: Alberto | last post by:
I'm trying to load an image in a PictureBox but I want the PictureBox has always the same size and if the image is bigger, show a scrollBars. How can I do it? Thank you
1
12800
by: marco | last post by:
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(object sender, System.EventArgs e) { PictureBox.Width = PictureBox.Width + (PictureBox.Width * 2);
2
7470
by: marco | last post by:
I'm a newbie and i'm doing a little application in C# for a Pocket PC 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(object sender, System.EventArgs e) {
4
1572
by: Dan | last post by:
I have a folder with various images which are updated (externally) periodically and a web page with an image control, text and user control buttons. Depending on the users actions, I want to display a picture and associated text. It all works fine except that the pictures are distorted to fill the image control. Is there any way I can display the picture in its original proportions without externally resixing each picture to the...
1
11160
by: Al | last post by:
I'm using visual C# 2005 Express Edition and I would like to open the image in the picture box, without make the picture box larger. For the moment, the code is: private void button1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); Image img = Image.FromStream(openFileDialog1.OpenFile()); pictureBox1.Image = img; pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize; //but this only modifies the size of the pictureBox
7
2624
by: Georges Bessis | last post by:
The image I set as background are left at original size. In a picturebox, I can decide to strech the image. Can I do that to fill my background ? Regards GB
1
1682
by: Ricardo Furtado | last post by:
I've been with a problem for about two months and i've bought books and search the internet for an explanation, and haven't found one. I'm developing a cephalometric software, that needs to capture an image from the scanner, mark the image with dots in order to find distances and angles. Everything is ok except when i try to zoom in/zoom out the image. Every calculated angle and distance becomes variable because when i use the zoom the...
4
12302
by: wasishincar | last post by:
I'm trying to read a bitmap and zoom in/out it on screen. I wrote some code but it did not perform as I expect. The bitmap shift 1 pixel to the upper-left coner when zooming in/out button was clicked. Please kindly help me to check if anything wrong with my code. Many many thanks. using System.Drawing; using System.Drawing.Drawing2D; // Click Browse to open bitmap file
0
9345
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
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
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
9905
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
8780
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
7332
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...
0
5229
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2752
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.