如何在asp.net Web应用程序中放大和缩小? [英] How to do Zoom In and Zoom out in asp.net web application ?

查看:133
本文介绍了如何在asp.net Web应用程序中放大和缩小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了图形的位图我已经绘制了矩形



这个矩形我想要放大并缩小这个位图?



Code Begind旁边代码:



I have used bitmap using graphics i have drawn rectangle

this rectangle i want Zoom in and zoom out for this bit map?

Code Begind Side code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    Response.Clear();
    int height = 600;
    int width = 800;
    Random r = new Random();
    int x = r.Next(75);

    Bitmap bmp = new Bitmap(width, height, PixelFormat.Format24bppRgb);
    Graphics g = Graphics.FromImage(bmp);

    g.TextRenderingHint = TextRenderingHint.AntiAlias;
    g.Clear(Color.Orange);
    //g.DrawRectangle(Pens.White, 1, 1, width-3, height-3);
    //g.DrawRectangle(Pens.Gray, 2, 2, width-3, height-3);
    g.DrawRectangle(Pens.Black, 0, 0, width, height);

    g.DrawRectangle(Pens.Black, 100, 100, 400, 400);
    g.DrawRectangle(Pens.Black, 150, 150, 300, 300);
    g.DrawRectangle(Pens.Black, 200, 200, 200, 200);
    g.DrawRectangle(Pens.Black,250, 250, 100, 100);
    //g.DrawString("The Code Project", new Font("Arial", 12, FontStyle.Italic),
    //SystemBrushes.WindowText, new PointF(x,50));

    bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
    g.Dispose();
    bmp.Dispose();
    Response.End();
    }
}









现在我想采取像zoomin和zoomout这样的2个按钮,同时点击这个按钮我要缩小并放大?在asp.net web表单中。





Now i want to take 2 buttons like zoomin and zoomout while clicking this buttons i want to zoom out and zoom in? in asp.net web form.

推荐答案

这篇关于如何在asp.net Web应用程序中放大和缩小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆