We have a Problem when printing images (blobObject).
We are printing all displayed images immediately on the report. The images are represented on the report by Blob objects. At runtime we create a Bitmap object in memory, which is stored in a memory stream, the byte array of MemoryStream is placed in the field of the DataSet, which has deposited on the report as BlobObjekt.
The error that occurs is that some Windows-User didnu2019t see all pictures. But without any Errormessage, the picture is still white.
All users use the same Windows-PC with the Crystal Report Version 10.2.3600.0 .
The difference between the pictures is simple:
- Note: This picture appears properly
- This one exists as JPG-File on the harddisk
- We read the image, convert it into a memory stream and place the byte array in de DataSet-Field
- This images are positioned in the header and footer section
- Note: this picture does not display properly
- This one is created by the application
- It is created in memory by an graphics-object
- This graphics-Object is converted into an memory stream and so on
- This images are positioned in the details section
Here are the piece of code, which is the dataset supplied with pictures. (abbreviated version)
Using stream As IO.MemoryStream = New IO.MemoryStream Using dest As Bitmap = New Bitmap(field.Width, field.Height) Using gd As Graphics = Graphics.FromImage(dest) gd.Clear(Color.White) gd.DrawImage(Source, destrect, sourcerect, GraphicsUnit.Pixel) dest.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp) End Using End Using ds.Tables(datasourceTableName).Rows(j)(datasourceName) = stream.ToArray stream.Close() End Using
Has anyone an ideo whats going wrong?
The logic to print the images is always the same only the windows user is different.