Added width and height parameters to rendering for easier output control

This commit is contained in:
Sam Lown 2010-06-11 19:42:51 +02:00
parent 2cea2399d9
commit 847cd70e32
3 changed files with 73 additions and 54 deletions

View file

@ -179,7 +179,7 @@ extern int grid_matrix(struct zint_symbol *symbol, unsigned char source[], int l
extern int png_handle(struct zint_symbol *symbol, int rotate_angle);
#endif
extern int render_plot(struct zint_symbol *symbol, unsigned int hide_text);
extern int render_plot(struct zint_symbol *symbol, unsigned int hide_text, float width, float height);
extern int bmp_handle(struct zint_symbol *symbol, int rotate_angle);
extern int ps_plot(struct zint_symbol *symbol);
@ -868,9 +868,13 @@ int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol, char *filename,
*
* Converts encoded data into an intermediate format to be interpreted
* in other applications using this library.
*
* If the width and height are not set to zero, the barcode will be resized to those
* dimensions. The symbol->scale and symbol->height values are totally ignored in this case.
*
*/
int ZBarcode_Render(struct zint_symbol *symbol, unsigned int hide_text)
int ZBarcode_Render(struct zint_symbol *symbol, unsigned int hide_text, float width, float height)
{
// Send the request to the render_plot method
return render_plot(symbol, hide_text);
return render_plot(symbol, hide_text, width, height);
}