Onreder에서 DrawingContext로 그리는 것은 장면 뒤에있는 작업을 수행합니까?

StackOverflow https://stackoverflow.com/questions/9519504

  •  14-11-2019
  •  | 
  •  

문제

나는 별도의 UIElement의 onRender 메소드를 무시하고 DrawingContext를 사용하여 프리미티브를 직접 그립니다.

내 질문은 정확히 일어나는 일은 정확히 일어나는 일입니까?내가 이해하는 한, 이것이 보유 된 모드를 사용하지 않는 것입니다 (내가 도형을 제어에 배치하는 경우 사례가 될 것입니다).나는 이렇게 생각하는 그 그림이 실제로 자신의 문제를 가져 오는 뒤에서 GDI +를 사용하는 것이 불안해하기 때문에 질문을하고 있습니다 (예 : GDI +와 함께 그려진 인쇄물은 이미 우리의 시간과 노력을 비용으로 그려졌습니다).

좋은 자원이 있습니까 (나에게 계몽 할 수있는 것처럼 보이지 않는 명백한 MSDN 자원 외에도

또는 모든 것이 완전히 틀렸어?

올바른 방향으로 나를 가리키는 답변에 감사드립니다. [편집 : 철자]

도움이 되었습니까?

해결책

You are still using retained mode, you're just not using high level objects (no animating objects, etc..), but instead simple points, lines, etc..

I've dug into the sources of DrawingContext and from what I can tell, it seems to be pushing all those DrawXYZ commands into a queue using some low-level wizardry (the queue itself consists of arbitrarily sized structs, each denoting a certain command).

WPF then processes this queue on another thread, denoted the rendering thread in this question. I haven't verified this, but I'm guessing that WPF uses the StreamingContext for all its drawing.

Furthermore, WPF is using DirectX for rendering, as can be seen by this bogpost, which takes a better look at what WPF actually does.

I hope this clarifies things for you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top