On 31 oct, 23:32, Patrice <contact-on...@xxxxxx-si.com> wrote:
> On 31 oct, 23:25, "Laurent Bugnion, MVP" <galasoft...@xxxxxx>
> > > How to retrieve the bitmap image of a given WPF control (or
> > > visualtree) ?
> > > I'd like to be able to insert a kind of control "screen copy" in an
> > > arbitrary destination (a Word document for instance). Is there an easy
> > > way to do that ? I think I've seen that somewhere but I can't remember
> > > where.
> > Check the thread named "Draw a circle in WPF" earlier in this very forum.
> Yeah, I've seen it just after having posted my message. It seems it
> answers perfectly my question. thnax a lot !- Masquer le texte des messages précédents -
> - Afficher le texte des messages précédents -
I tried to use your code but I got the same issue described in the
last post of the thread you mentioned (empty image).
And I can't figure what I'im doing wrong.
Here is my code (vb sorry
Public Function GetImageFromVisual(ByVal Target As Visual, ByVal
width As Integer, ByVal height As Integer) As RenderTargetBitmap
Dim bounds As Rect =
Dim renderBitmap As New RenderTargetBitmap(width, height, 96,
Dim visual As New DrawingVisual()
Dim context As DrawingContext = visual.RenderOpen
Dim brush As New VisualBrush(Target)
context.DrawRectangle(brush, Nothing, New Rect(New
If ever you can see something...
Thanx in advance