Create an image file of a QR code.
Namespace: diQRcodeNetAssembly: diQRcodeNet (in diQRcodeNet.dll) Version: 4.0.0.26352 (4.0.0.1)
Syntaxpublic static int CreateImage(
string outFile,
string inputStr,
ImageType imageType = ImageType.Gif,
int nPixelsPerModule = 0,
int margin = 0,
Ecc level = Ecc.M,
Options options = Options.Default
)
Public Shared Function CreateImage (
outFile As String,
inputStr As String,
Optional imageType As ImageType = ImageType.Gif,
Optional nPixelsPerModule As Integer = 0,
Optional margin As Integer = 0,
Optional level As Ecc = Ecc.M,
Optional options As Options = Options.Default
) As Integer
Parameters
- outFile String
- Name of output image file to be created.
- inputStr String
- Text input to be encoded (ANSI characters only).
- imageType ImageType (Optional)
- Image type (GIF/SVG) (default = GIF).
- nPixelsPerModule Int32 (Optional)
- Number of pixels per module (default = 2 ppm).
- margin Int32 (Optional)
- Size of margin in modules (default = 4 modules).
- level Ecc (Optional)
- Error correction level (default = M).
- options Options (Optional)
- Set as Escaped to indicate #-escaped sequences in the input string.
Return Value
Int32Zero on success, or a nonzero
error code.
Exampleint n = QRcode.CreateImage("hello.gif", "hello world");
if (n != 0) Console.WriteLine("Error: {0}", QRcode.ErrorLookup(n));
n = QRcode.CreateImage("hello.svg", "hello world", ImageType.Svg);
if (n != 0) Console.WriteLine("Error: {0}", QRcode.ErrorLookup(n));
See Also