Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,063 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,587 people online right now. Registration is fast and FREE... Join Now!




Two questions about the PictureBox control

 
Reply to this topicStart new topic

Two questions about the PictureBox control

cygnusX
17 Apr, 2008 - 12:34 AM
Post #1

D.I.C Head
**

Joined: 19 May, 2007
Posts: 159



Thanked: 2 times
My Contributions
1.When i zoom the image in a PictureBox and then zoom out the quality of the image is reduced.I'm using this code for zoom in and zoom out:

CODE
//zoom in
Image image = new Bitmap(pictureBox.Image, pictureBox.Image.Width + 50, pictureBox.Image.Height + 50);
pictureBox.Image = image;

//zoom out
Image image = new Bitmap(pictureBox.Image, pictureBox.Image.Width - 50, pictureBox.Image.Height - 50);
pictureBox.Image = image;

How to achieve zoom in and zoom out without affecting the quality of the image?

2.How to move the image in PictureBox?I mean when the image is zoomed i'm drawing vertical and horizontal scrollbars but i don't know what to do after that...

This post has been edited by cygnusX: 17 Apr, 2008 - 12:35 AM
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Two Questions About The PictureBox Control
17 Apr, 2008 - 08:26 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,919



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Anytime time you physically resize an image to a larger size, the image quality is going to degrade. This is due to the fact the the picture uses a fixed resolution. So when you resize, the resolution stays the same. The dots that make up the picture just get bigger, hence the pixelation of the image.

Your best bet to avoid this is to have two different size images and just swap out the picture in the PictureBox when you want the larger/smaller picture.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 06:37PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month