⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 service.cs

📁 输入:小波分析的结果或傅立叶分析的结果 输出:图像(bmp) web服务
💻 CS
字号:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Drawing;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
    private cwavelet ImageWavelet;
    private caxis AxisWavelet;
    private Bitmap image;
    private caxis AxisFourier;
    private cFourier ImageFourier;




    public Service () {

        //如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }

    [WebMethod]
    public string DrawWavelet(int datanumber, double xMin, double xMax, double yMin, double yMax, double[] wavedata, int scatWidth, int scatHight, String basepicture, String targetName)
    {

        ImageWavelet=new cwavelet();
        AxisWavelet =new caxis();
        
        if (basepicture == null)
        {
            image = new Bitmap(scatWidth, scatHight);
            Graphics g1 = Graphics.FromImage(image);
            g1.Clear(Color.White);
            ImageWavelet.waveletdraw(datanumber, xMin, xMax, yMin, yMax, wavedata,image);                   //画点对象初始化

            AxisWavelet.axisdraw(xMin, xMax, yMin, yMax, image);    //画坐标轴对象初始化

        }
        else
        {
            image = new Bitmap(basepicture);
            ImageWavelet.waveletdraw(datanumber, xMin, xMax, yMin, yMax, wavedata, image);                   //画点对象初始化

            AxisWavelet.axisdraw(xMin, xMax, yMin, yMax, image);    //画坐标轴对象初始化


        }


 
        //保存生成的图像
        string thefullname = Server.MapPath("./") + "\\" + targetName;
        image.Save(thefullname, System.Drawing.Imaging.ImageFormat.Bmp);
        return thefullname;
          
    }
    [WebMethod]
    public string DrawFourier(int datanumber, double xMin, double xMax, double yMin, double yMax, double[] wavedata, int scatWidth, int scatHight, String basepicture, String targetName)
    {
        ImageFourier = new cFourier();
        AxisFourier = new caxis();

        if (basepicture == null)
        {
            image = new Bitmap(scatWidth, scatHight);
            Graphics g1 = Graphics.FromImage(image);
            g1.Clear(Color.White);
            ImageFourier.Fourierdraw(datanumber, xMin, xMax, yMin, yMax, wavedata, image);                   //画点对象初始化

            AxisFourier.axisdraw(xMin, xMax, yMin, yMax, image);    //画坐标轴对象初始化

        }
        else
        {
            image = new Bitmap(basepicture);
            ImageFourier.Fourierdraw(datanumber, xMin, xMax, yMin, yMax, wavedata, image);                   //画点对象初始化

            AxisFourier.axisdraw(xMin, xMax, yMin, yMax, image);    //画坐标轴对象初始化


        }



        //保存生成的图像
        string thefullname = Server.MapPath("./") + "\\" + targetName;
        image.Save(thefullname, System.Drawing.Imaging.ImageFormat.Bmp);
        return thefullname;

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -