update 20250129
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -74,19 +74,27 @@ namespace BarcodeLib
|
||||
}
|
||||
public Image DrawText1(Color foreColor, Color backColor, string fontName, int fontSize, string txt, int width, int height, string zusatz,string zusatzfontname, int zusatzfontsize , int rotation)
|
||||
{
|
||||
//width = 320;
|
||||
//height = 50;
|
||||
|
||||
string barcodetext = txt;
|
||||
barcodetext = Bar25I(txt);
|
||||
Bitmap img = new Bitmap(width, height);
|
||||
Graphics Gimg = Graphics.FromImage(img);
|
||||
Font imgFont = new Font(fontName, fontSize);
|
||||
PointF imgPoint = new PointF(5, 5);
|
||||
PointF imgPoint = new PointF(0, 0);
|
||||
SolidBrush bForeColor = new SolidBrush(foreColor);
|
||||
SolidBrush bBackColor = new SolidBrush(backColor);
|
||||
Gimg.FillRectangle(bBackColor, 0, 0, width, height);
|
||||
Gimg.DrawString(txt, imgFont, bForeColor, imgPoint);
|
||||
Gimg.DrawString(barcodetext, imgFont, bForeColor, imgPoint);
|
||||
|
||||
|
||||
|
||||
Font fzFont = new Font(zusatzfontname, zusatzfontsize);
|
||||
|
||||
SizeF textSize = Gimg.MeasureString(zusatz, fzFont, 50);
|
||||
SizeF textSize = Gimg.MeasureString(zusatz, fzFont,30);
|
||||
|
||||
PointF imgPointZusatz = new PointF(width - textSize.Width - 15, 30);
|
||||
PointF imgPointZusatz = new PointF(width - textSize.Width , 25);
|
||||
Gimg.DrawString(zusatz, fzFont, bForeColor, imgPointZusatz);
|
||||
|
||||
return RotateImage(img, rotation, true, true, Color.White);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user