my source
 
AutoGenerateColumns="false" onrowdatabound="grddata_RowDataBound"
Height="16px">
Bramandam
Bramandam
Bramandam
Bramandam
Bramandam
 
 
 my code
 
protected void grddata_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (GridViewRow gvr in this.grddata.Rows)
{
string barCode = (gvr.FindControl("lotno") as Label).Text;
System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image();
using (Bitmap bitMap = new Bitmap(barCode.Length * 40, 80))
{
using (Graphics graphics = Graphics.FromImage(bitMap))
{
Font oFont = new Font("Elfring Bar Code 39 d Hb", 28);
PointF point = new PointF(2f, 2f);
SolidBrush blackBrush = new SolidBrush(Color.Black);
SolidBrush whiteBrush = new SolidBrush(Color.White);
graphics.FillRectangle(whiteBrush, 0, 0, bitMap.Width, bitMap.Height);
graphics.DrawString("*" + barCode + "*", oFont, blackBrush, point);
}
using (MemoryStream ms = new MemoryStream())
{
bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byte[] byteImage = ms.ToArray();
Convert.ToBase64String(byteImage);
imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage);
}
(gvr.FindControl("plBarCode") as PlaceHolder).Controls.Add(imgBarCode);
}
}
foreach (GridViewRow gvr in this.grddata.Rows)
{
string barrCode = (gvr.FindControl("lotno") as Label).Text;
System.Web.UI.WebControls.Image imgBarCoe = new System.Web.UI.WebControls.Image();
using (Bitmap birtMap = new Bitmap(barrCode.Length * 40, 80))
{
using (Graphics grraphics = Graphics.FromImage(birtMap))
{
Font oFonrt = new Font("Elfring Bar Code 39 d Hb", 28);
PointF poinrt = new PointF(2f, 2f);
SolidBrush blackBrrush = new SolidBrush(Color.Black);
SolidBrush whiteBrrush = new SolidBrush(Color.White);
grraphics.FillRectangle(whiteBrrush, 0, 0, birtMap.Width, birtMap.Height);
grraphics.DrawString("*" + barrCode + "*", oFonrt, blackBrrush, poinrt);
}
using (MemoryStream mrs = new MemoryStream())
{
birtMap.Save(mrs, System.Drawing.Imaging.ImageFormat.Png);
byte[] byterImage = mrs.ToArray();
Convert.ToBase64String(byterImage);
imgBarCoe.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byterImage);
}
(gvr.FindControl("plBarCoode") as PlaceHolder).Controls.Add(imgBarCoe);
}
}
foreach (GridViewRow gvr in this.grddata.Rows)
{
string barrsCode = (gvr.FindControl("lotno") as Label).Text;
System.Web.UI.WebControls.Image igBarCode = new System.Web.UI.WebControls.Image();
using (Bitmap birtsMap = new Bitmap(barrsCode.Length * 40, 80))
{
using (Graphics grraphsics = Graphics.FromImage(birtsMap))
{
Font oFonrst = new Font("Elfring Bar Code 39 d Hb", 28);
PointF poinrst = new PointF(2f, 2f);
SolidBrush blackBrrussh = new SolidBrush(Color.Black);
SolidBrush whiteBrrussh = new SolidBrush(Color.White);
grraphsics.FillRectangle(whiteBrrussh, 0, 0, birtsMap.Width, birtsMap.Height);
grraphsics.DrawString("*" + barrsCode + "*", oFonrst, blackBrrussh, poinrst);
}
using (MemoryStream msrs = new MemoryStream())
{
birtsMap.Save(msrs, System.Drawing.Imaging.ImageFormat.Png);
byte[] bytersImage = msrs.ToArray();
Convert.ToBase64String(bytersImage);
igBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(bytersImage);
}
(gvr.FindControl("plBarCodde") as PlaceHolder).Controls.Add(igBarCode);
}
}
foreach (GridViewRow gvr in this.grddata.Rows)
{
string barrsCorde = (gvr.FindControl("lotno") as Label).Text;
System.Web.UI.WebControls.Image imBarCode = new System.Web.UI.WebControls.Image();
using (Bitmap birtsrMap = new Bitmap(barrsCorde.Length * 40, 80))
{
using (Graphics grraphsicrs = Graphics.FromImage(birtsrMap))
{
Font oFonrsrt = new Font("Elfring Bar Code 39 d Hb", 28);
PointF poinrsrt = new PointF(2f, 2f);
SolidBrush blackBrrussrh = new SolidBrush(Color.Black);
SolidBrush whiteBrrussrh = new SolidBrush(Color.White);
grraphsicrs.FillRectangle(whiteBrrussrh, 0, 0, birtsrMap.Width, birtsrMap.Height);
grraphsicrs.DrawString("*" + barrsCorde + "*", oFonrsrt, blackBrrussrh, poinrsrt);
}
using (MemoryStream msrsr = new MemoryStream())
{
birtsrMap.Save(msrsr, System.Drawing.Imaging.ImageFormat.Png);
byte[] bytersrImage = msrsr.ToArray();
Convert.ToBase64String(bytersrImage);
imBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(bytersrImage);
}
(gvr.FindControl("plBarCCode") as PlaceHolder).Controls.Add(imBarCode);
}
}
foreach (GridViewRow gvr in this.grddata.Rows)
{
string baarrsCode = (gvr.FindControl("lotno") as Label).Text;
System.Web.UI.WebControls.Image imgBaCode = new System.Web.UI.WebControls.Image();
using (Bitmap bairtsMap = new Bitmap(baarrsCode.Length * 40, 80))
{
using (Graphics garraphsics = Graphics.FromImage(bairtsMap))
{
Font oaFonrst = new Font("Elfring Bar Code 39 d Hb", 28);
PointF paoinrst = new PointF(2f, 2f);
SolidBrush balackBrrussh = new SolidBrush(Color.Black);
SolidBrush wahiteBrrussh = new SolidBrush(Color.White);
garraphsics.FillRectangle(wahiteBrrussh, 0, 0, bairtsMap.Width, bairtsMap.Height);
garraphsics.DrawString("*" + baarrsCode + "*", oaFonrst, balackBrrussh, paoinrst);
}
using (MemoryStream masrs = new MemoryStream())
{
bairtsMap.Save(masrs, System.Drawing.Imaging.ImageFormat.Png);
byte[] baytersImage = masrs.ToArray();
Convert.ToBase64String(baytersImage);
imgBaCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(baytersImage);
}
(gvr.FindControl("plBarCodee") as PlaceHolder).Controls.Add(imgBaCode);
}
}
}
 
 
 
my code