加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java画图程序_图片用字母画出来_源码发布

发布时间:2020-12-14 06:30:57 所属栏目:Java 来源:网络整理
导读:在之前写了一篇blog:java画图程序_图片用字母画出来 主要是把一些调试的截图发布出来,现在程序调试我认为可以了(当然,你如果还想调试的话,也可以下载源码自己调试)。 就把源码发布出来。 原图:http://images.cnblogs.com/cnblogs_com/hongten/356471/

在之前写了一篇blog:java画图程序_图片用字母画出来

主要是把一些调试的截图发布出来,现在程序调试我认为可以了(当然,你如果还想调试的话,也可以下载源码自己调试)。

就把源码发布出来。

原图:http://images.cnblogs.com/cnblogs_com/hongten/356471/o_imagehandler_cat.png

Including TWO functions : Color image to converted black and white picture. Imitating the original image to paint into the TXT file with alphabets. [][] result = StringBuffer stringBuffer = File input = File out = }

String PATH = "src/com/b510/image/resources/" String ORIGINAL_IMAGE = PATH + "original_image.png" String PROCESSED_IMAGE = PATH + "processed_image.png" String OUTPUT_TXT = PATH + "output.txt" String PROCESSED_SUCCESS = "Processed successfully..." String PROCESS_ERROR = "Processing encounters error!" String R = "R" String A = "A" String X = "X" String M = "M" String W = "W" String H = "H" String E = "E" String J = "J" String L = "L" String C = "C" String V = "V" String Z = "Z" String Q = "Q" String T = "T" String r = "r" String s = "s" String w = "w" String u = "u" String l = "l" String i = "i" String e = "e" String m = "m" String a = "a" String COMMA = "," String BLANK = " " String NEW_LINE = "n" }

height = 0 width = 0 Image image = srcH = image.getHeight( srcW = image.getWidth( BufferedImage bufferedImage = bufferedImage.getGraphics().drawImage(image,srcW, bufferedImage = ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY),).filter(bufferedImage, FileOutputStream fos = JPEGImageEncoder encoder = } File file = [][] result = (! BufferedImage bufImg = result = ( y = 0; y < height; y++ ( x = 0; x < width; x++ temp = Double.valueOf(bufImg.getRGB(x,y) & 0xFFFFFF result[y][x] = } BufferedImage readImage(File file) BufferedImage bufImg = height = width = StringBuffer getCanvas( StringBuffer stringBuffer = ( y = 0; y < height; y++ ( x = 0; x < width; x++ StringBuffer(stringBuffer.substring(0,stringBuffer.length() - 1 fullBlank([][] result,StringBuffer stringBuffer, y, (result[y][x] > 0.0 && result[y][x] < 168.0 } (result[y][x] >= 168.0 && result[y][x] < 212.0 } fullBlackColor([][] result, (result[y][x] > 0.0 && result[y][x] < 25.0 } (result[y][x] >= 25.0 && result[y][x] < 50.0 } (result[y][x] >= 50.0 && result[y][x] < 75.0 } (result[y][x] >= 75.0 && result[y][x] < 100.0 } (result[y][x] >= 100.0 && result[y][x] < 125.0 } (result[y][x] >= 125.0 && result[y][x] < 150.0 } (result[y][x] >= 150.0 && result[y][x] < 154.0 } (result[y][x] >= 154.0 && result[y][x] < 158.0 } (result[y][x] >= 158.0 && result[y][x] < 162.0 } (result[y][x] >= 162.0 && result[y][x] < 168.0 fullGreyColor([][] result, (result[y][x] >= 168.0 && result[y][x] < 172.0 } (result[y][x] >= 172.0 && result[y][x] < 176.0 } (result[y][x] >= 176.0 && result[y][x] < 180.0 } (result[y][x] >= 180.0 && result[y][x] < 184.0 } (result[y][x] >= 184.0 && result[y][x] < 188.0 } (result[y][x] >= 188.0 && result[y][x] < 192.0 } (result[y][x] >= 192.0 && result[y][x] < 196.0 } (result[y][x] >= 196.0 && result[y][x] < 200.0 } (result[y][x] >= 200.0 && result[y][x] < 204.0 } (result[y][x] >= 204.0 && result[y][x] < 208.0 } (result[y][x] >= 208.0 && result[y][x] < 212.0 fullWhiteColor([][] result, (result[y][x] >= 212.0 && result[y][x] < 216.0 } (result[y][x] >= 216.0 && result[y][x] < 220.0 } (result[y][x] >= 220.0 && result[y][x] < 224.0 } (result[y][x] >= 224.0 && result[y][x] < 228.0 } (result[y][x] >= 228.0 && result[y][x] < 232.0 } (result[y][x] >= 232.0 && result[y][x] < 236.0 } (result[y][x] >= 236.0 && result[y][x] < 240.0 } (result[y][x] >= 240.0 && result[y][x] < 244.0 } (result[y][x] >= 244.0 && result[y][x] < 248.0 } (result[y][x] >= 248.0 && result[y][x] < 252.0 } (result[y][x] >= 252.0 && result[y][x] < 257.0 }

File f = BufferedWriter output = output = BufferedWriter( } }

源码下载:http://files.cnblogs.com/hongten/imageHandler.rar

========================================================

More reading,and english is important.

I'm Hongten

大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。Hongten博客排名在100名以内。粉丝过千。Hongten出品,必是精品。

E | hongtenzone@foxmail.com ?B |?

========================================================

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读