Skip to content

How to add dummy bytes to make the line width multiple of 64/128 bytes? #5406

Answered by ogoffart
markszente asked this question in Q&A
Discussion options

You must be logged in to vote

If you are using the SoftwareRenderer::render, you can allocate a bigger buffer and change the stride. But unfortunately, the stride being in pixel and not byte, you can't add 32 bytes :-(.

What you can do is add 12 pixels (288 bytes) at the end of each lines. That's some wasted spaces, but maybe that helps.

In a future version of Slint we should change the software renderer to have a trait TargetBuffer instead of TargetPixel which would have a function to retrieve lines.

Another solution is to render line by line into the buffer using the render_by_line function

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by markszente
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants