zoom+graphics+bitmap using CE;

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alarock
    New Member
    • Jan 2008
    • 14

    zoom+graphics+bitmap using CE;

    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....
Working...