ASP.NETC#中,打印网页时,图像颜色会发生改变。
创始人
2024-09-17 07:00:50
0

1.在页面头部加入以下代码,以确保打印输出为彩色图像,并设置分辨率为300 DPI。

protected void Page_Init(object sender, EventArgs e) { if (!this.Page.ClientScript.IsStartupScriptRegistered("Print")) { // Set printing options this.Page.ClientScript.RegisterStartupScript(this.GetType(), "Print", "var printing = false; function printEOI() {if (!printing){ printing = true; window.print(); }};", true); } }

2.在需要打印图像的页面上,将图像的CSS样式更改为以下代码:

img.print { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0) progid:DXImageTransform.Microsoft.Chroma(color='#999999') /* Change #999999 to the color you want the image to be */ progid:DXImageTransform.Microsoft.Alpha(opacity=100) }

3.在打印时,通过以下代码将图像的CSS类应用于要打印的图像。这将确保图像在打印输出中保持与屏幕上相同的颜色。

// Apply print CSS to image Image1.CssClass = "print"; // Call the print function ClientScript.RegisterStartupScript(Page.GetType(), "Print", "printEOI();", true);

相关内容

热门资讯

玩家必备科普!wepoker私... 玩家必备科普!wepoker私人局辅助,wpk真吗,一直真的有挂(有挂猫腻)玩家必备科普!wepok...
玩家必看教程!hhpoker是... 玩家必看教程!hhpoker是真的吗,wpk辅助软件,真是真的是有挂(确实有挂)1、下载好正确养号方...
揭秘攻略!德普之星透视辅助插件... 揭秘攻略!德普之星透视辅助插件,德州局脚本,原来真的是有挂(证实有挂)1、在插件功能辅助器技巧中,中...
教程攻略!pokerrrr2辅... 教程攻略!pokerrrr2辅助,wepoker辅助器官方,一贯是真的有挂(发现有挂)1、每一步都需...
我来分享!wepokerplu... 我来分享!wepokerplus辅助,wepoker黑侠破解,一直有挂(有挂方式)1、任何透视是真的...
9分钟了解!we-poker辅... 9分钟了解!we-poker辅助软件教程,购买的wpk辅助在哪里下载,真是是有挂(有挂细节)1、让任...
我来教教你!德普之星辅助工具如... 我来教教你!德普之星辅助工具如何打开,德州透视插件,真是是真的有挂(有挂功能)1、有没有辅助教程、有...
必备科技!we-poker辅助... 必备科技!we-poker辅助软件教程,购买的wpk辅助在哪里下载,真是存在有挂(今日头条)暗藏猫腻...
玩家亲测!hhpoker买挂,... 玩家亲测!hhpoker买挂,wepoker私人局辅助器怎么用,竟然是真的有挂(有挂细节)1)wep...
解密关于!德州局透视脚本免费版... 解密关于!德州局透视脚本免费版下载手机版,德州机器人代打脚本,总是是真的有挂(有挂秘籍)1、公共底牌...