pabloh007 0 Newbie Poster

I'm running into a problem when trying to render images in a RDLC, I added the code in the report code section, however all i get is a red "X" for my image. When I run the code in windows form the image generates fully but doesn't generate when trying it in report viewer.

Here is the function code in the report

Public Function MakeBarcode(ByVal Code As String) As Byte()
        Dim b As New IDAutomation.BarCode
        b.DataToEncode = Code
        b.SymbologyID = IDAutomation._Symbology.CODE128
        Dim img As System.Drawing.Image
        img = Microsoft.VisualBasic.Compatibility.VB6.IPictureToImage(b.GetEnhWMF())
        Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream()
        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
        Dim bmpbytes As Byte() = ms.ToArray()
        ms.Close()
        Return bmpbytes
    End Function

I don't get any error just the image never appears just a red X?
these are the picture settings

MIMEType:image/png
Source:Database
Value:code.MakeBarcode("123")

thanks! any help appreciated