2014年4月3日
摘要: 原理 用 canvas的 toDataURI (type , int) 如果type参数的值为image/jpeg或image/webp,则第二个参数的值如果在0.0和1.0之间的话,会被看作是图片质量参数dataURI转 blob的代码是 copy 来的压缩代码/*common*/var canvasSupported = isCanvasSupported()function dataURItoBlob(dataURI) { // convert base64 to raw binary data held in a string var byteString ... 阅读全文
posted @ 2014-04-03 11:35 雨弓 阅读(22835) 评论(9) 推荐(0) 编辑
  2014年3月20日
摘要: test chrome paste image test image paste in browser copy the following img, then paste it into the area below this is an editable div area paste the image into here. 阅读全文
posted @ 2014-03-20 19:59 雨弓 阅读(731) 评论(0) 推荐(0) 编辑
  2014年2月8日
摘要: 1 function(){ 2 elem.addEventListener('touchstart', start , false) 3 elem.addEventListener('touchend', end , false) 4 elem.addEventListener('touchmove', move , false) 5 var coefficient = .02 6 var fingers 7 8 var threshold = {'dbl_tap':400, 'tap':250} 9 var st 阅读全文
posted @ 2014-02-08 16:47 雨弓 阅读(1113) 评论(0) 推荐(0) 编辑
  2014年1月27日
摘要: var http = require('http'), ,spawn = require('child_process').spawnfunction onRequest(req, res) { var reqUrl = req.url if ('/' == reqUrl || 'favicon.ico' == reqUrl) { return res.end('Im debugger') } res.writeHead(200 ,{'Content-Type': 'text/plain&# 阅读全文
posted @ 2014-01-27 15:00 雨弓 阅读(781) 评论(0) 推荐(0) 编辑
  2013年12月26日
摘要: var http = require('http'), fs = require("fs"), url = require('url'), querystring = require('querystring')function onRequest(req, res) { var reqUrl = req.url if ('/' == reqUrl || 'favicon.ico' == reqUrl) { return res.end('Im debugger') } var 阅读全文
posted @ 2013-12-26 18:41 雨弓 阅读(6433) 评论(3) 推荐(0) 编辑
  2013年12月3日
摘要: 图片拖动选区http://www.css88.com/EasyTools/javascript/jQueryPlugin/imgAreaSelect/# 阅读全文
posted @ 2013-12-03 15:27 雨弓 阅读(106) 评论(0) 推荐(0) 编辑
  2013年10月10日
摘要: 1 2 22 23 32 33 34 35 36 74 阅读全文
posted @ 2013-10-10 19:44 雨弓 阅读(869) 评论(0) 推荐(0) 编辑
  2013年8月5日
摘要: canvas绘图后用 canvasDom.toDataURL()可以得到png格式图片的base64 dataURI然后用ajax post给后台 ,后端程序把开头的data:image/png;base64, 去掉 得到base64内容然后decode存入文件即可今天碰到的坑是 node base64_decode的时候网上说的都是 new Buffer(p , 'base64').toString()但把这个内容写入文件 图片怎么都是损坏 反复尝试后得到正确的图片的方法是new Buffer(p , 'base64') 没有后面的toString 把流写入文 阅读全文
posted @ 2013-08-05 16:20 雨弓 阅读(6508) 评论(3) 推荐(1) 编辑
  2013年7月16日
摘要: http://blog.bbkanba.com/%E9%85%8D%E7%BD%AElinux%E4%B8%8Bdircolorsls%E5%91%BD%E4%BB%A4%E5%92%8Cmac%E4%B8%8Biterm2%E7%9A%84%E9%A2%9C%E8%89%B2%E8%AE%A9%E7%BB%88%E7%AB%AFiterm2%E6%88%96terminal%E4%B9%9F%E8%89%B2%E5%BD%A9/cd ~wget --no-check-certificate https://github.com/seebi/dircolors-solarized/raw/ma 阅读全文
posted @ 2013-07-16 16:16 雨弓 阅读(4376) 评论(0) 推荐(0) 编辑
  2013年7月5日
摘要: 昨天的滑块建立在Input range这个基础上 这是IOS5.0及以后才支持的,而且在android2.3以下表现也不对昨天的检测方式var input = document.createElement('input');input.setAttribute('type','range')console.log(input.type == 'range')不能完全检测出不支持。今天找到了modernizrhttp://modernizr.com/docs/#installing 看了人家的方式 ,感觉老外真是有耐心啊inputE 阅读全文
posted @ 2013-07-05 10:42 雨弓 阅读(534) 评论(0) 推荐(0) 编辑