473,398 Members | 2,404 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,398 software developers and data experts.

Scaling a bitmap in a picturebox

Hi,

I'm writing a program that based on input will create a document. It is
something simulair as a printing example.
In MS Word when you click on the shown document you can zoom in and if you
click again you'll zoom out again.

This is what I would like to do as well.
I draw the document in a bitmap, since all the information is drawn from a
database and on the form it is shown in a picturebox.

So what I'm trying to find out is how I can zoom in a certain factor by
clicking somewhere in the document.
If I use the SCALE method I can zoom in and out but how can I move the
bitmap so that the point clicked on is shown in the center of the
picturebox.

Please give me some directions on how to do this?

thanks,
Eric
Aug 5 '06 #1
2 4547
Hello Eric,

Check out the PrintDocument class and the print preview features of the framework.

-Boo
Hi,

I'm writing a program that based on input will create a document. It
is
something simulair as a printing example.
In MS Word when you click on the shown document you can zoom in and if
you
click again you'll zoom out again.
This is what I would like to do as well.
I draw the document in a bitmap, since all the information is drawn
from a
database and on the form it is shown in a picturebox.
So what I'm trying to find out is how I can zoom in a certain factor
by
clicking somewhere in the document.
If I use the SCALE method I can zoom in and out but how can I move the
bitmap so that the point clicked on is shown in the center of the
picturebox.
Please give me some directions on how to do this?

thanks,
Eric

Aug 6 '06 #2
Zoompicbox, an article on my site, will help you get started with this.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Eric" <so*****@MicroZoft.comwrote in message
news:44**********************@text.nova.planet.nl. ..
Hi,

I'm writing a program that based on input will create a document. It is
something simulair as a printing example.
In MS Word when you click on the shown document you can zoom in and if you
click again you'll zoom out again.

This is what I would like to do as well.
I draw the document in a bitmap, since all the information is drawn from a
database and on the form it is shown in a picturebox.

So what I'm trying to find out is how I can zoom in a certain factor by
clicking somewhere in the document.
If I use the SCALE method I can zoom in and out but how can I move the
bitmap so that the point clicked on is shown in the center of the
picturebox.

Please give me some directions on how to do this?

thanks,
Eric


Aug 7 '06 #3

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

Similar topics

3
by: jeff | last post by:
Hiya, Im currently in the process of developing a picture browser, I want it to run off a CD, basically I have 2 questions for the group. The first is how do I get the program to only view the...
1
by: James Dean | last post by:
I have tried a few different methods for scaling an image down but all seem a bit on the slow side. Is there any way i can make this scaling faster....... Here is how i do it now. To display my...
2
by: Sharon | last post by:
I encountered a strange behavior when doing ‘new Bitmap’: The following code works fine and the given bitmap file is shown on the PictureBox (the m_DrawArea) in the correct bitmap sizes: ...
2
by: active | last post by:
Problem: The PictureBox display appears to have the image cut off. I.e., the image bottom does not display although the PictureBox has room for it. It occurred to me that what was displayed was...
3
by: Larry Serflaten | last post by:
I am taking a 256 color bitmap from a file and scaling it up X 16 to a 32bppPARGB bitmap in memory. I copy that image to the screen. After scaling, the edges of all the lines and colors are...
2
by: Peter Proost | last post by:
Hi group I have the following piece of code that should resize the bitmap in a picture box but it doesn't work as I tought it would. Can someone help me with it? thnx Peter Public Class...
2
by: Mad Scientist Jr | last post by:
I have a bitmap (32 pixels high, 8192 pixels wide) that contains 255 images, each 32 pixels wide, that I would like to chop up into individual 32x32 bitmap files. Rather than spending hours in...
1
by: Eric | last post by:
Hi, I'm writing a program that based on input will create a document. It is something simulair as a printing example. In MS Word when you click on the shown document you can zoom in and if you...
2
by: =?Utf-8?B?Sm9uIFBhcnJ5?= | last post by:
Hi, I've got a Picturebox, into which I am putting a frame bitmap from a video camera. The camera bitmap is larger than the picturebox, which has SizeMode set to "Zoom" which causes the bitmap...
0
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Using VS2005 with .NET Framework 2.0 I'm using the the System.Windows.Forms.PictureBox to display a bitmap when the PictureBox.SizeMode is PictureBoxSizeMode.StretchImage The PictureBox can be...
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...
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...
0
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,...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.