I strored binary data in MSSQL server table for image file and i want it to render on pdf report i am doing so by following code but eventually i am getting a distorted image over pdf.Can you please explain what could be the reason and how to overcome over it.
Private Sub CreateHeader()
Dim mainRow As Infragistics.Documents.Report.Table.ITableRow
Dim bandHeaderSP As Infragistics.Documents.Report.Band.IBandHeader = bandSP.Header
mainTable = bandHeaderSP.AddTable
mainRow = mainTable.AddRow()
imageCell = mainRow.AddCell
‘Getting the datarow from data logic which is not written
Dim r As DataRow
imageCell .AddImage(GetBinaryImage(30, 10, TryCast(r.Item("Test_Icon"), Byte())))
End Sub
GetBinaryImage = Nothing
Dim imageToAdd As Infragistics.Documents.Graphics.Image = New Infragistics.Documents.Graphics.Image(width, height, imageData)
Catch ex As Exception
End Function
What do you mean that the image is distored? Does the image appear normally if you load the imagine into a PictureBox on the form? Can you post a screenshot?
-Matt
Hi,
Can you replicate the situation by using above code.Actually I am able to get the proper image on pdf by another way
Note-: imageData is Byte array
stm = New System.IO.MemoryStream(imageData)
Dim imageToAdd As Infragistics.Documents.Graphics.Image = New Infragistics.Documents.Graphics.Image(stm)
but problem hear is i can not set height and width for image so overall it affects the other elements of pdf document.
Regards
Sandeep Gohane