Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
740
How to put a background image in a cell
posted

Hi,

With infragistics documents i'm working to create various documents. With the table object i place text and numers in cells.
Now i'm looking for the possibility to put an image in a cell as the cell background. Is this possible?
I've looking in the documentation and it seems possible but can't find any code how to do this.

On a side note: it would be very usefull if you can do a search in this forum in a specific forum group. For example in this case do a search in the subgroup infragistics.documents.

Kind regards,

Jacob Iedema

Parents
No Data
Reply
  • 740
    Verified Answer
    Offline posted

    Found a way on this forum with a similar question. Changed code a bit.

    First create class with following code:

    Private Class MyDrawing
    Implements IDrawing
    Public Sub OnDraw(graphics As Reports.Graphics.IGraphics, x As Single, y As Single, width As Single, height As Single) Implements IDrawing.OnDraw
    Dim image As New Reports.Graphics.Image("filename.jpg")
    graphics.DrawImage(image, x, y, Utils.Converter.PixelsToPoints(image.Width), Utils.Converter.PixelsToPoints(image.Height))
    End Sub
    End Class

    Place this line in code where you need it:

    MyCell.Background = New Infragistics.Documents.Reports.Report.Background(Reports.Graphics.Brushes.White, New MyDrawing)

Children