I am trying to capture the image of WPF application's Dialog using Bitmap actualBmp = element.Capture(); like one below
yellow color refers to the actual dialog and other colour refers to the main page of the application.
But it returns something like below (Image of the main page with the actual size of the dialog)
I want something like below to be captured