471,071 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 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 889

Post your reply

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

Similar topics

6 posts views Thread by johannblake | last post: by
13 posts views Thread by Crirus | last post: by
2 posts views Thread by Chris Morse | last post: by
4 posts views Thread by Carl Gilbert | last post: by
2 posts views Thread by Mo Ade via .NET 247 | last post: by
3 posts views Thread by Boni | last post: by
1 post views Thread by Ricardo Furtado | last post: by
4 posts views Thread by wasishincar | last post: by
2 posts views Thread by =?Utf-8?B?Sm9uIFBhcnJ5?= | last post: by

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.