이봐 난 WPF 응용 프로그램에서 이미지를 얻기 위해 노력하고 모든 :WPF UI 자동화 찾는 이미지
당신은 이미지가 트리
"원격 전화"창 아래에서 볼 수 있듯이 > "" "custom>" "이미지
텍스트 상자와 버튼을 찾고 단추를 호출하는 방법을 찾았지만 아직 이미지를 가져 와서 표시 할 수있는 코드를 찾지 못했습니다. 내 양식 상자 안에.
LogMessage("Getting RootElement...");
AutomationElement rootElement = AutomationElement.RootElement;
if (rootElement != null)
{
LogMessage("OK." + Environment.NewLine);
Automation.Condition condition = new PropertyCondition(AutomationElement.NameProperty, "Remote phone");
LogMessage("Searching for Remote Phone Window...");
AutomationElement appElement = rootElement.FindFirst(TreeScope.Children, condition);
if (appElement != null)
{
LogMessage("OK " + Environment.NewLine);
LogMessage("Searching for Image...");
AutomationElement txtElementA = GetTextElement(appElement, "image");
if (txtElementA != null)
etc..etc...
IT는 appElement이 잘 찾지 만 그것은 txtElementA에 도달하면 그것은 자신이 GetTextElement 대신 사진/이미지 요소를 찾고 있기 때문에해야 NULL입니다.
이미지를 찾고 그것을 잡아 내 양식의 그림 상자에 표시하는 적절한 코드는 무엇입니까?
감사합니다.