Bonjour à tous,

Je voudrais imprimer des objets tels qu'ils apparaissent à l'écran (en l'occurence un GroupBox)
Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
Imports System.Drawing.Bitmap
Public Class1
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
                 PrintPreviewDialog1.Document = PrintDocument1
                 PrintPreviewDialog1.ShowDialog()
        End Sub
        Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
                 Dim Bmp As New Bitmap(GroupBox1.Width, GroupBox1.Height)
                 GroupBox1.DrawToBitmap(Bmp, New Rectangle(0, 0, Bmp.Width, Bmp.Height))
                 e.Graphics.DrawImage(Bmp, 0, 10, GroupBox1.Width, GroupBox1.Height)
        End Sub
End Class
Problème j'ai aussi importé iTextSharp (j'en ai besoin pour créer des Pdf), ce qui génère une erreur au niveau de Rectangle "Impossible de convertir une valeur de type 'iTextSharp.text.Rectangle' en 'System.Drawing.Rectangle'

Quelqu'un connait-il la solution pour éviter ce conflit ?

Merci à ceux qui prendront le temps de me répondre