473,609 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

zoom+graphics+b itmap using CE;

14 New Member
HI
THIS IS MY CODE..I WANT TO ZOOM THE BITMAP..HOW IT IS POSSIBLE???

using System;
using System.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows. Forms;

namespace WindowsApplicat ion1
{
public partial class Form1 : Form
{
public Bitmap bmp;
private Graphics grfx;
public Form1()
{
bmp=new Bitmap(this.Wid th,this.Height) ;
grfx=Graphics.F ormImage(bmp);
grfx.PageUnit=G raphicsUnit.Mil limeter;
this.Autoscroll minsize=bmp.Siz e;
InitializeCompo nent();
}
protected override void OnMouseClick(Mo useEventArgs e)
{
grfx.DrawRectan gle(new Pen(color.Red), 2,2,30,50);
base.OnMouseCli ck(e);
}

protected override void OnMouseWheel(Mo useEventArgs e)
{

/// here i want to perform the zoom operation of the bitmap (or) grfx...
base.OnMouseWhe el(e);
}
protected override void OnPaint(PaintEv entArgs pe)
{
Graphics Grfxbmp=pe.grap hics;
Grfxbmp.DrawBit map(bmp,this.Au toscrolPosition .x,AutoscrolPoi sition.y,bmp.wi dth,bmp.height) ;
base.OnPaint(e) ;
}


}
}


Thanks And regards,
ALGATES....
Apr 1 '08 #1
0 1012

Sign in to post your reply or Sign up for a free account.

Similar topics

6
8145
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters for scaling. This can sometimes get rather complex when you need to take scaling into account or other things like window resizing, scrolling, etc. There is a property called PageUnit which can be set to World. I could not find any examples...
13
2064
by: Crirus | last post by:
The main ideea: I havea 513x513 array of values....I draw a sort of map using that values for colors... so I have a realistic lanscape (map). I want to zoom about 60 times that map...and the zoomed area to be drawn on full screen. I want to draw it smoth not a square of 60 pixels x 60 pixels with one color, because I can see blocks and it's not good. There is a way to interpoate the colors between rectangles to show a smoth zoom?
2
6003
by: Chris Morse | last post by:
Hi, I'm trying to create a little program that loads a 1bpp bitmap (black/white) and displays it in a PictureBox using the PictureBox's Paint event. I have buttons for zooming in/out and I calculate the source image origin rectangle and the destination rectangle. Problem is that the image should look "blocky" when I zoom in, but instead it looks *very* anti-aliased.
4
1803
by: Carl Gilbert | last post by:
Hi I was looking for a component that will enable me to zoom into an image very easily and quickly. I was hoping there may be something, perhaps part of VB.NET, that will allow me to drag a box over a selected area and this would then be displayed at full screen. Any help on this would be greatly appreciated. Kind regards, Carl Gilbert
2
12673
by: Mo Ade via .NET 247 | last post by:
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>
3
3315
by: Boni | last post by:
Dear all, I need a picturebox on which I can with GDI+ draw rectangles. The scroll and zoom should be supported. Do I have to manually resize rectangles,when zoom button clicked and change position when scroll done and redraw with new coordinates? Is there some standard procedure for that? Any link or advice is greatly appreciated. Thanks, Boni
1
1673
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
12290
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
2
8590
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 to be resized and correctly displayed. My question is whether letting the Picturebox do the bitmap resizing is the most efficient mechanism, or whether it would be preferable to perfrom the resizing myself before passing the modified image to...
0
8127
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
8067
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
8527
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
8215
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
8398
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6053
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
4015
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
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1380
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.