DrawImage problem (not retaining the pixel configuration)
- From: "Ajay" <Ajay@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Apr 2005 05:39:02 -0700
Hello Guys,
Iam working on a zoom in and out tool and here is the code iam using for it
//Method for zooming in
Bitmap bmpSource=new Bitmap(ImgBox.Image);
Bitmap bmpZoomed=new
Bitmap(bmpSource.Width*ZoomInFactor,bmpSource.Height*ZoomInFactor);
Graphics grZoom=Graphics.FromImage(bmpZoomed);
grZoom.InterpolationMode=InterpolationMode.HighQualityBilinear;
grZoom.DrawImage(bmpSource,0,0,bmpZoomed.Width+1,bmpZoomed.Height+1);
ImgBox.Image=bmpZoomed;
//Method for zooming Out
Bitmap bmpSource=new Bitmap(ImgBox.Image);
Bitmap bmpZoomed=new
Bitmap(bmpSource.Width/ZoomInFactor,bmpSource.Height/ZoomInFactor);
Graphics grZoom=Graphics.FromImage(bmpZoomed);
grZoom.InterpolationMode=InterpolationMode.HighQualityBilinear;
grZoom.DrawImage(bmpSource,0,0,bmpZoomed.Width+1,bmpZoomed.Height+1);
ImgBox.Image=bmpZoomed;
It is working fine but the picture resulution is lost if we do symultaneous
multiple zoomin and zoom out..Specially if you zoomout first and then zoom
in...
Any ideas on how to retain the pixel configuration ....
Any valuable thought should help
Cheerz,
Ajay
.
- Follow-Ups:
- Re: DrawImage problem (not retaining the pixel configuration)
- From: Andrew Murray
- Re: DrawImage problem (not retaining the pixel configuration)
- Prev by Date: Re: static function question
- Next by Date: Re: very newbie question
- Previous by thread: keyed-MD5 Implementation
- Next by thread: Re: DrawImage problem (not retaining the pixel configuration)
- Index(es):
Relevant Pages
|