a.maleki
یک شنبه 12 مهر 1388, 10:30 صبح
دوستان سلام میخواستم بدونم چظوری ما می تونیم روی عکس عملیات زوم کردن رو انجام بدیم
BahmanDB
یک شنبه 12 مهر 1388, 11:09 صبح
سلام دوست عزیز شما می تونید از jquery استفاده کنید .
یا هم از این کد :
protected void Page_Load(object sender, EventArgs e)
{
Mouse mouse = (Mouse)Session[Mouse.SessionName];
ImageViewParameters Pageparams = (ImageViewParameters)Session[ImageViewParameters.SessionName];
if (mouse == null || Pageparams == null )
{
Server.Transfer("Zoomzoom.aspx");
}
string loc = Request.QueryString[PageVariables.ImagePath].ToString(); // this.ImageButton1.ImageUrl.Replace("~", "");
if (loc == null)
{
return;
}
if (loc.Length < 5)
{
return;
}
Bitmap bitmap = new Bitmap(loc);
MouseToImageCoordinates(mouse, Pageparams, bitmap);
// Dimentions of the zoomed square
float squareSizeX = (int)( (float)bitmap.Width / (float)Pageparams.ZoomLevel );
float squareSizeY = (int)((float) bitmap.Height / (float)Pageparams.ZoomLevel );
// Create a new bitmap which we will draw on
Bitmap bitmap2 = new Bitmap(bitmap.Width, bitmap.Height);
// Get the graphics device from the blank image
Graphics g = Graphics.FromImage( bitmap2 );
// Make a rect around where the user clicked
float desX = ( mouse.X - (squareSizeX / 2.0f) ) ;
float desY = ( mouse.Y - (squareSizeY / 2.0f) );
RectangleF source = new RectangleF(desX, desY, squareSizeX, squareSizeY);
RectangleF destination = new RectangleF(0, 0, bitmap.Width, bitmap.Height);
g.DrawImage(bitmap, destination, source, GraphicsUnit.Pixel);
// Output the image to the stream
bitmap2.Save(Response.OutputStream, ImageFormat.Jpeg);
}
BahmanDB
یک شنبه 12 مهر 1388, 11:15 صبح
این هم یه مثال برای zoom عکس :
mic_r_c
یک شنبه 12 مهر 1388, 22:28 عصر
سلام
آقا بهمن اینجا تالار J2ME یه و کد شما ASPx
البته منظور رو رسوندی!
به این لینک سر یزن http://svtln.blogfa.com/post-9.aspx
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.