Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to render content of Control object? #6036

Closed
alex-aparin opened this issue Oct 5, 2021 · 3 comments
Closed

How to render content of Control object? #6036

alex-aparin opened this issue Oct 5, 2021 · 3 comments
Labels
no-issue-activity product-winui3 WinUI 3 issues question team-Rendering Issue for the Rendering team

Comments

@alex-aparin
Copy link

I want to create lightweight custom control, which will only render its content in specific way (without any additional logic like mouse/key handling etc). I think that it will be derived from Control class. But I cannot understand the rendering model of Win UI 3. How can I redefine painting of control? Where can I find good description how rendering is performed within Win UI 3. P.S. due documentation, I guess that it uses similar model like WPF (but it is only my suspiction)

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Oct 5, 2021
@llothar
Copy link

llothar commented Oct 11, 2021

I hope we get this answered with documentation link and sample code.

The main difference is that it is now a retained drawing model where you don't redefine painting (thats only for backward compatibility and i would guess slower than the new native way) but setup composition drawing items which are keept in a scene graph. I currently port my Linux version from GTK3 -> GTK4 which is doing the same step as WinUI3 and it's all far from easy and self explaining. Especially when it comes to hand optimized drawing.

@alex-aparin
Copy link
Author

@llothar By the way WPF has also retained drawing model. But it allows to override painting of controls. It has pretty effective way to draw lines, rectangle etc. (via direct drawing into visual object - these instruction will be serialized to be performed on GPU). Unfortunately WinUi 3 does not have such support. Instead you should use either builtin controls like Line, Path, Rectangle or some surfaces which support DirectX. Builtin controls derive Shape class, it cannot be effective way because such classes have memory overhead etc.

@StephenLPeters StephenLPeters added product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team labels Oct 20, 2021
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Dec 6, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-issue-activity product-winui3 WinUI 3 issues question team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

4 participants