Modify the code:
private
void
callButton_Click(object
sender,
EventArgs
e)
{
BarcodeService.BarcodeSvcSoapClient
service =
new
BarcodeClient.BarcodeService.BarcodeSvcSoapClient();
BasicHttpBinding
httpBinding =
service.ChannelFactory.Endpoint.Binding
as
BasicHttpBinding;
httpBinding.MaxBufferSize = 1024 *
1024;
httpBinding.MaxReceivedMessageSize
= 1024 * 1024;
httpBinding.ReaderQuotas.MaxArrayLength
= 1024 * 1024;
service.CreateBarcodeCompleted
+=
new
EventHandler<BarcodeClient.BarcodeService.CreateBarcodeCompletedEventArgs>(service_CreateBarcodeCompleted);
service.CreateBarcodeAsync(10, 10,
10, 10,
"Super
Title",
10, true,
textBox1.Text, textBox2.Text,
textBox3.Text, textBox4.Text,
textBox5.Text,
24, 8,
true,
"gif");
}
void
service_CreateBarcodeCompleted(object
sender, BarcodeClient.BarcodeService.CreateBarcodeCompletedEventArgs
e)
{
byte[]
buffer = e.Result;
MemoryStream
stream =
new
MemoryStream(buffer);
Bitmap
bmp =
new
Bitmap(stream);
pictureBox.Width = bmp.Width;
pictureBox.Height = bmp.Height;
pictureBox.Image = bmp;
}