C# Class Cryptid.CardGenerator

Generates a Cryptid ID card image for a specified candidate
Exibir arquivo Open project: CryptidID/Cryptid Class Usage Examples

Public Methods

Method Description
CardGenerator ( Candidate cardCandidate, string pdfTemplateFile ) : System

Creates a new CardGenerator instance

Generate ( string outputFile, byte chainId ) : void

Generates the Cryptid ID card

ImageToBitmap ( Image img ) : Bitmap

Converts an iText image to a Bitmap

Private Methods

Method Description
TrimBitmap ( Bitmap source ) : Bitmap

Trims the whitespace around a bitmap

Method Details

CardGenerator() public method

Creates a new CardGenerator instance
public CardGenerator ( Candidate cardCandidate, string pdfTemplateFile ) : System
cardCandidate Candidate The candidate to create the card for
pdfTemplateFile string The PDF template to generate the card
return System

Generate() public method

Generates the Cryptid ID card
public Generate ( string outputFile, byte chainId ) : void
outputFile string The locaton to output the Cryptid ID
chainId byte The chainId of this candidate
return void

ImageToBitmap() public method

Converts an iText image to a Bitmap
public ImageToBitmap ( Image img ) : Bitmap
img iTextSharp.text.Image The iText image
return System.Drawing.Bitmap