Save canvas to bitmap

前端 未结 6 469
感动是毒
感动是毒 2020-12-06 02:32

I want to save my canvas to bitmap. I found some examples in internet, but all of those saves only black image (with size of my canvas). What can I do with this?

Co

6条回答
  •  日久生厌
    2020-12-06 03:37

    In my render-code i call target.UpdateLayout(); after target.Arrange(new Rect(size));, maybe that will fix it. Also note that if the canvas background is not set it will be rendered as transparent, while encoding to BMP that might turn into solid black, so if you only have black objects they might be invisible.

提交回复
热议问题