25% of the world's people have procrastination--but I think it's definitely less, at least I'm a patient with procrastination. Always want to "Java generated business card (with background image, user network picture, user nickname) of the two-dimensional code" this blog share, but has been dragged and dragged, dragged to the present, really should be the Scottish proverb-" when you can do things, often do
JAVA Development-[QR code business card generation system], java Generation System
Last month, the school had a software innovation cup. Recently, I saw a very popular QR code on the Internet. According to some technical articles
1. using Swetakeqrcode to generate a QR code in a Java projecthttp://swetake.com/qr/ or Http://sourceforge.jp/projects/qrcode/downloads/28391/qrcode.zip .This was written by the Japanese and generated by our common square QR code
For a long time did not publish a blog, today sent a Java tool class, suddenly found that the draft box unexpectedly has the previous inventory, one-time hair!!!Catalogue 1. QR code concept 2. development History of QR code 3. Two-dimensional
Java QR code tool class, with a LOGO in the middle, very powerful, java tool class logo
Jar package download maven configuration: Xml Code collection code
Scan the code to log on to JAVA and scan java
Reference (Development Platform): https://open.weixin.qq.com/cgi-bin/showdocument? Action = dir_list t = resource/res_list verify = 1 id = open1419425518 lang = zh_CN
Summary (implementation process ):
A. Registration (Pay): Get the appid, secret, and the domain name to jump to after setting the scan
The QR code generated in Java is directly output to the page if it is not saved to the disk. Therefore, the generated QR code needs to be output directly to the page in the form of a stream, I use myeclipse and tomcat.
The principle is: when loading a page, according to the
) {File=NewFile ("E:" +file.separator+ "xxx.xxx");//own default storage path} imageio.write (image, format, file); returnfile; } V. Conversion into a streamIf you need to upload to a picture server, you need to convert bufferedimage into stream form /*** @Description: convert bufferedimage-> output stream *@paramimage Two-dimensional code content *@paramformat picture formats such as JPG, GIF, etc. *@paramOutputStream Output Stream *@return * @thro
Step 1 download the zpxing. jar package and load it in (there are many similar jar packages on the Internet. Here we use the jar provided by Google)
QR code tool:
Package com. zpxing. controller; import java. awt. basicStroke; import java. awt. graphics; import java. awt. g
After reading the QR code today, I felt good. I also collected a demo, saying that the demo was actually modified based on the basic functions.
1. Set up the environment. The required jar packages include
Here is the online reference demo.
Where
To make modifications based on the original and open-source packages.
2. QR c
Java uses Zxing to generate a QR code. Zxing is a parsing tool provided by Google for bar code (one-dimensional code and two-dimensional code). It provides a method for generating and parsing
)) { Throw NewIOException ("Could not write an image of format" +format); } } //generate a QR code picture content: Contents, url: Build Path Public Staticstring Genqrcode (String content,string URL) {//Verify that there are folderscreatedir.createdir (URL); String filename=NULL; //picture format of QR codeString format = "png"; Hashtable hints
Source: http://blog.csdn.net/wangpeng047/article/details/7181217 (thanks and respect for the original author)
Normal use of the following code to do the jar package required, free points: http://download.csdn.net/detail/zihan11201120/4969485
1 package com.zihan.org; 2 3 Import Java. text. dateformat; 4 Import Java. text. simpledateformat; 5 import
implementation of this method#pragma mark-#pragma mark Nscopying methodThis method needs to be implemented to support the memo-(ID) Copywithzone: (Nszone *) zone{Using the Self class here is a type that you want its subclasses to return as well as subclasses.Yiche *yichecopy = [[Self class]allocwithzone:zone]init];return yichecopy;}The specific scene class will no longer write, mainly to explain the prototype model of a simple example, and then write the time also feel that there are some short
QR code generation helper class [java] package com. dream. qrcodeen; import java. awt. image. bufferedImage; public class TwoDimensionCodeImage {BufferedImage bufImg; public TwoDimensionCodeImage (BufferedImage bufImg) {this. bufImg = bufImg;} public int getHeight () {return bufImg. getHeight ();} public int getPixel (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.