can

xiaoxiao2021-03-06  14

using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D; using System.Web; using System.Web.SessionState; using System.Web.ui; use system.web.ui.webcontrols; using system.web.ui.htmlcontrols;

Namespace azhou88gupiao {///

/// WebForm2 summary description. /// public class Webform2: system.Web.ui.page {public string image; public string round1; private void page_load (Object sender, system.eventargs e) {// Rectangle (); round (); } The two parameters of the Public Void Rectangle () // {// // bitmap object change the length of the created bitmap object. The bitmap object that has been created can be displayed through the Save method of the Bitmap class. / Since the bitmap file should take much space, in order to facilitate network transmission, / generally convert to "JPEG" or "GIF" file to keep. // bitmap image = new bitmap (400, 400); // // Graphics G = Graphics. FromImage (image); // g. FillRectangle (New Solidbrush (Color. Lightgreen), 0, 0, 400, 400); // Image. Save (response. OutputStream, Imageformat. JPEG); //} public Void Round () {

Bitmap runk1 = new bitmap (400, 400); graphics g = graphics. FromImage (runk1); font "is a string font," Font Axesfont = New Font ("Arial, 10); brush" is defined brush, behind The two parameters are the position coordinates of the string. Brush BlackBrush = new solidbrush (color. Red); definition color pen redpen = new Pen (color. Red, 1); pen blackpen = new pen (color. Blue, 2);

g. FillRectangle (New Solidbrush (Color. Lightgreen), 0, 0, 400, 400); g. DrawString ("Writing text above, huh, 呵", Axesfont, BlackBrush, 90, 20); Define 3 Line PUBLIC Void Drawlines (Pen Pen, Point [] Points;

g. DrawLine (Blackpen, 0, 2, 210, 250); g. Drawline (Blackpen, 210, 250, 310, 50); g. Drawline (Redpen, 310, 50, 210, 350); // "JPEG "Save this image object in the format, displayed in the client Round1. Save (response. Outstream, imageformat. Jpeg);} #Region Web Form Designer Generated Code Override Protected Void OnInit (Eventargs E) {//// Codegen : This call is necessary for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {this.load = new system.eventhandler (this.page_load);

} #Endregion}}}

转载请注明原文地址:https://www.9cbs.com/read-50790.html

New Post(0)