Can anyone provide an example of using Canvas.DrawRoundedRect? I would like to use this but can't get it to work and can't find any example of its use.
Thanks,Kerry Jenkins
Kerry,
What's the problem that you're having? I would guess that you're not seeing anything because you're not setting the Brush on the canvas. You could set it to something like Infragistics.Documents.Graphics.Brushes.Red to see if your rect is showing up. If this isn't the problem, could you let me know what you are trying to do?
-Matt
Matt,
The problem that I am having is that I cannot get the rounded rectangle to be shown. In the SamplesGallery for Documents Exporting Engine in the Infragistics Windows Forms Feature Browser I commented out the DrawRectangle and added a DrawRoundedRect below. The rectangle is drawn but the corners are not rounded. I have tried different values for the 5th and 6th argument of the DrawRoundedRect but cannot get a rounded corners to be displayed.
' Rectangle canvas.StartHyperlink(1, 0, 10) canvas.Pen = New Infragistics.Documents.Graphics.Pen(Infragistics.Documents.Graphics.Colors.Red, 5) canvas.Brush = New Infragistics.Documents.Graphics.SolidColorBrush(New Infragistics.Documents.Graphics.Color(255, 240, 240)) 'canvas.DrawRectangle(50, 50, 150, 100, Infragistics.Documents.Graphics.PaintMode.FillStroke) canvas.DrawRoundedRect(50, 50, 150, 100, 150, 100, Infragistics.Documents.Graphics.PaintMode.FillStroke) canvas.AddHyperlinkArea(50, 50, 150, 100) canvas.EndHyperlink()
Thanks,Kerry
I can't seem to get this to work either, so it could be a bug. You should submit this issue to Developer Support. Unfortunately I don't really have a good workaround, though you can do most graphics operations either directly on the canvas or from the .NET graphics object that is returned through canvas.CreateGraphics(), so there may be some rounded rect implementations on the internet that you could use.