FAQ TBarCode nelle applicazioni Web
Come posso trasmettere in streaming un'immagine di codice a barre al browser (client)?
Come posso trasmettere in streaming un'immagine di codice a barre al browser (client)?
Con TBarCode è possibile trasmettere in streaming un'immagine di codice a barre (ad es. basata su parametri GET o POST) al client.
Potete dare un'occhiata al nostro generatore di codici a barre online, dove facciamo esattamente questo.
Questo URL trasmette in streaming un'immagine di codice a barre (Data Matrix con codificata la parola "TBarCode") al browser: http://barcode.tec-it.com/barcode.ashx
Usate questo frammento di codice per TBarCode .NET come punto di partenza in ASP.NET:
// first adjust the barcode properties of the myBarcode object (class Barcode) // then calculate the width and height of the code in Pixels (sample available on request) // then write the barcode image as stream to the browser as follows Bitmap image = myBarcode.DrawBitmap(width, height); image.SetResolution(dpi, dpi); Response.Clear(); Response.ContentType = "image/gif"; image.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif); HttpContext.Current.ApplicationInstance.CompleteRequest(); image.Dispose();
Il setup SDK contiene l'applicazione web Barcode Generator ASP.NET (nella cartella esempi), che è in grado di trasmettere in streaming immagini al browser utilizzando l'assembly Barcode Generator di TBarCode .NET. Questa applicazione può anche essere installata sul vostro server web.