当前位置: 首页 > news >正文

茂名网站建设电话建设银行投诉处理网站

茂名网站建设电话,建设银行投诉处理网站,漂亮的网页设计欣赏,seo是什么牌子问题 生成缩略图生成验证码生成二维码给图片加水印 外部引用 Node 不解释 https://nodejs.org/en/download/sharp 高性能缩略图 https://github.com/lovell/sharpqr-image 二维码 https://github.com/alexeyten/qr-imagecaptchagen 验证码 https://github.com/contra/ca… 问题 生成缩略图生成验证码生成二维码给图片加水印 外部引用 Node  不解释  https://nodejs.org/en/download/sharp 高性能缩略图  https://github.com/lovell/sharpqr-image  二维码  https://github.com/alexeyten/qr-imagecaptchagen  验证码  https://github.com/contra/captchagennode-images  轻量级跨平台图像编解码库 https://github.com/zhangyuanwei/node-images 生成缩略图代码resizeImage.js var sharp require(sharp); module.exports function (result, physicalPath, mimeType, maxWidth, maxHeight) {     // Invoke the sharp NPM module, and have it pipe the resulting image data back to .NET     sharp(physicalPath)         .resize(maxWidth || null, maxHeight || null)         .pipe(result.stream); } ResizeController.cs public class ResizeController : Controller     {         private const int MaxDimension 1000;         private static string[] AllowedMimeTypes new[] { image/jpeg, image/png, image/gif };         private IHostingEnvironment _environment;         private INodeServices _nodeServices;         public ResizeController(IHostingEnvironment environment, INodeServices nodeServices)         {             _environment environment;             _nodeServices nodeServices;         }         [Route(resize_{maxWidth}_{maxHeight}/{*imagePath})]         public async TaskIActionResult Index(string imagePath, int maxWidth, int maxHeight)         {              imagePath imagePath;             // Validate incoming params             if (maxWidth 0 || maxHeight 0 || maxWidth MaxDimension || maxHeight MaxDimension                 || (maxWidth maxHeight) 0)             {                 return BadRequest(Invalid dimensions);             }             var mimeType GetContentType(imagePath);             if (Array.IndexOf(AllowedMimeTypes, mimeType) 0)             {                 return BadRequest(Disallowed image format);             }             // Locate source image on disk             var fileInfo _environment.WebRootFileProvider.GetFileInfo(imagePath);             if (!fileInfo.Exists)             {                 return NotFound();             }             // Invoke Node and pipe the result to the response             var imageStream await _nodeServices.InvokeAsyncStream(                 ./Node/resizeImage,                 fileInfo.PhysicalPath,                 mimeType,                 maxWidth,                 maxHeight);             return File(imageStream, mimeType);         }         private string GetContentType(string path)         {             string result;             return new FileExtensionContentTypeProvider().TryGetContentType(path, out result) ? result : null;         }     } 效果生成验证码代码captchagen.js var captchagen require(captchagen); module.exports function (result, width, height, text) {     // optional object arg with keys: height, width, text, font     var captcha captchagen.create({ width: width, height: height, text: text||8888});     captcha.generate(); // Draws the image to the canvas     /* call generate() before running the below */     captcha.stream().pipe(result.stream); // outputs an image stream. type can be either png or jpeg (png is the default) } 效果生成二维码代码 1 var qr require(qr-image);2 module.exports function (result, size, url) {3 qr.image(url, { type: png, size: size, margin: 1 })4      .pipe(result.stream);5 } 效果总结 安装Node引用组件时费了不少时间主要是因为没细看作者给出的各种环境下的安装说明。 加水印目前还没做好主要是要修改源码实现支持stream类型输出 抛砖引玉希望更多朋友分享 Node各种组件的应用. 原文地址http://www.cnblogs.com/wspnet/articles/NodeJS_NetCore_System_Drawing_Faq.html .NET社区新闻深度好文微信中搜索dotNET跨平台或扫描二维码关注
http://www.zqtcl.cn/news/441327/

相关文章:

  • 昆明门户网站建设wordpress权限设置
  • 设计网站建设图片wordpress博客置顶
  • 网站上海网站建设网站数据建设涉及哪些内容
  • 3d效果图教程网站宁波网站建设慕枫科技
  • 视频结交网站怎么做想创建一个网站
  • 电商网站销售数据分析上海企业信息登记号查询
  • 网站建设规划设计公司排名无锡网站建设 君通科技
  • 徐州网站开发要多少钱给个人网站做百度百科
  • 法语网站建设免费网站为何收录比较慢
  • 品牌网站推广软件seo内链优化
  • 广东律师事务所东莞网站建设做网站 怎么备案
  • shopnc本地生活o2o网站源码wordpress文章内多页效果
  • 深圳全国网站制作哪个好页面设计有哪几种风格
  • 网页设计作业网站素材和效果图夏天做啥网站致富
  • 利用帝国软件如何做网站网站友链交换平台
  • 简述网站开发技术深圳网站设计合理刻
  • wordpress网站名称寻找销售团队外包
  • 一浪网站建设网页qq邮箱
  • 做网站需要注册公司吗夫唯seo系统培训
  • 沈阳人流哪个医院好安全百度关键词优化怎么做
  • 1688网站怎么做分销高质量的网站内容建设
  • 网站建设公司济宁网站转跳怎么做
  • 镇江网站设计多少钱企业网络部署方案
  • 建网站的公司浩森宇特wordpress登录缓存
  • 便宜建站空间战队头像在线制作免费
  • 做招聘网站赚钱吗厦门网站建设哪里好
  • 新乡网站建设哪家公司好阿里巴巴做国际网站多少钱
  • 怎么在悉尼做网站dede做手机网站
  • 企业网站模板免费下载品牌建设专家库推荐表
  • 辽宁智能网站建设推荐网络营销推广方案创意