0

I was wondering if anyone can help me or give me any idea's regarding some work around to put a transparent background in the crystal report, basically this is what I need to do...

I am creating a report base on a data within the DGV(DataGridview), within the DGV there is a field for the path(Url) where the logo(Can be transparent or not ex.jpg,png, bitmap, etc...) is located.

When generating reports all logo will be downloaded and turned into byte() then inserted into the LINQ as the reports Datasource, now within the crystal report when the logo is transparent the logo will have a black background...

I searched that transparent are not supported in the CR, only WMF or EMF are supported that is why i need to make the transparent logo into a EMF or WMF before inserted into the report, but the problem is that "Bitmap","Drawing.Graphics", etc... functions is not really converting the transparent image into a vector format even if their file extension changes...

I also tried to create a new image then put a white background then paste the transparent logo into it using Graphics.DrawImage... it works :)... but the problem now is that the logo have different shade of white and it is not acceptable at all... here are some codes that i saw in the internet and tried... also all these process is need to be done without human intervention so i cannot change the logo into vector format using power points and cannot use word document as ole object because the image became crap...

    Dim result = New System.Drawing.Bitmap(OriginalImage.Size.Width, OriginalImage.Size.Height, Drawing.Imaging.PixelFormat.Format24bppRgb)
    Dim g = System.Drawing.Graphics.FromImage(result)
    g.Clear(Drawing.Color.White)
    g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver
    g.DrawImage(OriginalImage, 0, 0)
    result.Save(newFname, System.Drawing.Imaging.ImageFormat.Png)
Orion Star
  • 1
  • 1
  • 5

0 Answers0