I have an use case as follows,
Process proc = Process.Start("myproc.exe");
AutomationElement automationElement = AutomationElement.RootElement.FindFirst(TreeScope.Children,
new System.Windows.Automation.PropertyCondition(AutomationElement.ProcessIdProperty,
proc.Id));
var imageAutomationElmt = automationElement .FindFirst
(TreeScope.Descendants, new System.Windows.Automation.PropertyCondition
(AutomationElement.AutomationIdProperty, "imageData"));
HwndSource src = HwndSource.FromHwnd(Process.GetProcessesByName("myproc")[0].MainWindowHandle);
I was planning to acquire the Hwnd and then Visual and render it. But HwndSource is null. I understood all WPF controls need not necessarily have a HWND. All I need is to save the control's data to a file. I am aware of screen capture, but that doesnt suit
my use case, I need the actual data within my image control. How do I render my automation element to a file?