国产高清在线免费观看-国产高清在线免费无码-国产高清在线男人的天堂-国产高清在线视频-国产高清在线视频精品视频-国产高清在线视频伊甸园

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發文檔 其他文檔  
 
網站管理員

[點晴永久免費OA]C#將網址生成圖片

admin
2022年12月22日 10:57 本文熱度 1204

輸入任意網址.把該網址打開的網頁生成圖片

GetImage類

public class GetImage
    {
private int S_Height;
private int S_Width;
private int F_Height;
private int F_Width;
private string MyURL;

public int ScreenHeight
{
get { return S_Height; }
set { S_Height = value; }
}

public int ScreenWidth
{
get { return S_Width; }
set { S_Width = value; }
}

public int ImageHeight
{
get { return F_Height; }
set { F_Height = value; }
}

public int ImageWidth
{
get { return F_Width; }
set { F_Width = value; }
}

public string WebSite
{
get { return MyURL; }
set { MyURL = value; }
}

public GetImage(string WebSite, int ScreenWidth, int ScreenHeight, int ImageWidth, int ImageHeight)
{
this.WebSite = WebSite;
this.ScreenWidth = ScreenWidth;
this.ScreenHeight = ScreenHeight;
this.ImageHeight = ImageHeight;
this.ImageWidth = ImageWidth;
}

public Bitmap GetBitmap()
{
WebPageBitmap Shot = new WebPageBitmap(this.WebSite, this.ScreenWidth, this.ScreenHeight);
Shot.GetIt();
Bitmap Pic = Shot.DrawBitmap(this.ImageHeight, this.ImageWidth);
return Pic;
}

}
class WebPageBitmap
{
WebBrowser MyBrowser;
string URL;
int Height;
int Width;

public WebPageBitmap(string url, int width, int height)
{
this.Height = height;
this.Width = width;
this.URL = url;
MyBrowser = new WebBrowser();
MyBrowser.ScrollBarsEnabled = false;
MyBrowser.WebBrowserShortcutsEnabled = false;
MyBrowser.ObjectForscripting = false;
MyBrowser.Size = new Size(this.Width, this.Height);
}

public void GetIt()
{
MyBrowser.Navigate(this.URL);
while (MyBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
}

public Bitmap DrawBitmap(int theight, int twidth)
{
Bitmap myBitmap = new Bitmap(Width, Height);
Rectangle DrawRect = new Rectangle(0, 0, Width, Height);
MyBrowser.DrawToBitmap(myBitmap, DrawRect);
System.Drawing.Image imgOutput = myBitmap;
System.Drawing.Image oThumbNail = new Bitmap(twidth, theight, imgOutput.PixelFormat);
Graphics g = Graphics.fromImage(oThumbNail);
g.CompositingQuality = CompositingQuality.HighSpeed;
g.SmoothingMode = SmoothingMode.HighSpeed;
g.InterpolationMode = InterpolationMode.HighQualityBilinear;
Rectangle orectangle = new Rectangle(0, 0, twidth, theight);
g.DrawImage(imgOutput, orectangle);
try
{

return (Bitmap)oThumbNail;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
finally
{
imgOutput.Dispose();
imgOutput = null;
MyBrowser.Dispose();
MyBrowser = null;
}
}
}
public class OLayer
{
public void CaptureImage(string url)
{
System.Drawing.Bitmap x = null;
try
{
// string url = "http://" + Request.Url.Host + ":" + Request.Url.Port.ToString();
//url = url + UrlPath;

//GetImage thumb = new GetImage(url, 1024, 3200, 1024, 3200);
//生成頁面圖片的長寬高
GetImage thumb = new GetImage(url, 1024, 8000, 1024, 8000);
x = thumb.GetBitmap();
string FileName = DateTime.Now.ToString("yyyyMMddhhmmss");

//x.Save(System.Environment.CurrentDirectory + "\\cap\\" + FileName + ".jpg");
x.Save(System.Environment.CurrentDirectory + FileName + ".jpg");


//CaptureState = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
//CaptureState = false;
}
finally
{
if (x != null) x.Dispose();
}
}
}

頁面調用:

 OLayer ow = new OLayer();
ow.CaptureImage(tstr[i].ToString());

該文章在 2022/12/22 10:57:12 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業的專業生產管理軟件系統,系統成熟度和易用性得到了國內大量中小企業的青睞。
點晴PMS碼頭管理系統主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業務管理,結合碼頭的業務特點,圍繞調度、堆場作業而開發的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業的高效ERP管理信息系統。
點晴WMS倉儲管理系統提供了貨物產品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產管理,WMS管理系統,標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協同辦公管理系統。
Copyright 2010-2025 ClickSun All Rights Reserved

主站蜘蛛池模板: 国产午夜福利久久网 | 亚洲国产精品不卡毛片a在线 | 国语自产免费精品视频一区二区 | 久久久久国产综合av天堂 | 一本久久综合亚洲鲁鲁五月天 | 日韩毛片免 | 亚洲精品中文字幕无码视频 | 无码道dvd在线播放 无码的黄a在线观看 | 亚洲成色www成人网站妖精 | 麻豆一区二区99久久久久 | 成熟少妇AV片在线观看 | 国产在线不卡国产高清 | 无码人妻久久一区二区三区 | 国产成人aⅴ片在线观看 | 99精品国产一区二区三区不卡 | 国产乱子伦精品无码专区 | 亚洲一区二区三区成人网站 | 国产精品无码久久四虎 | 亚洲成人日韩六十熟妇乱子伦视频 | 三级黄rlri看三级黄 | 亚洲国产av大全一区 | 在线观看特色大片免费视频 | 国产在线精品亚洲观看不卡欧美 | 亚洲精品国偷拍自产在线观看 | 日韩精品人妻AV一区二区三区 | 日韩男女性爱视频 | 精品无码国产拍自产拍在线 | 亚洲美女高潮久久久久91 | 国产精品国产三级国产av品爱网 | 亚洲精品国产第一区二区多人 | 亚洲av无码专区亚洲av伊甸园 | 午夜福利福利一区二区三区 | 日本亚州视频在线八a | 亚洲国产成人片在线观看 | 51精品国产人成在线观看 | 色综合久久久无码中文字幕 | 亚洲另类国产精品无码 | 国产色情A片国语露对白 | 伊人久久精品无码二区色欲 | 丝袜美腿一区二区三区 | 国产三級精品专区 |