473,218 Members | 1,392 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,218 software developers and data experts.

zoom+graphics+bitmap using CE;

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

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Bitmap bmp;
private Graphics grfx;
public Form1()
{
bmp=new Bitmap(this.Width,this.Height);
grfx=Graphics.FormImage(bmp);
grfx.PageUnit=GraphicsUnit.Millimeter;
this.Autoscrollminsize=bmp.Size;
InitializeComponent();
}
protected override void OnMouseClick(MouseEventArgs e)
{
grfx.DrawRectangle(new Pen(color.Red),2,2,30,50);
base.OnMouseClick(e);
}

protected override void OnMouseWheel(MouseEventArgs e)
{

/// here i want to perform the zoom operation of the bitmap (or) grfx...
base.OnMouseWheel(e);
}
protected override void OnPaint(PaintEventArgs pe)
{
Graphics Grfxbmp=pe.graphics;
Grfxbmp.DrawBitmap(bmp,this.AutoscrolPosition.x,Au toscrolPoisition.y,bmp.width,bmp.height);
base.OnPaint(e);
}


}
}


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

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

Similar topics

6
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...
13
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...
2
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...
4
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...
2
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 ...
3
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...
1
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...
4
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...
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.