如何创建与RenderTargetBitmap大位图? [英] How to create BIG bitmaps with RenderTargetBitmap?

查看:314
本文介绍了如何创建与RenderTargetBitmap大位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用RenderTargetBitmap存储一个大的可视作为位图图像没有获得一个彻头彻尾的内存不足异常。什么是实现这一目标的最佳途径?

I need to store a big Visual as bitmap image using RenderTargetBitmap without obtaining an Out-Of-Memory exception. What is the best way to achieve this?

我没有问题,存储可视屏幕尺寸(让说1920x1200的像素),但在视觉上非常大发生崩溃(20000x20000像素)。

I have no problem storing a Visual the size of the screen (let say 1920x1200 pixels), but the crash occurs when the visual is very big (20000x20000 pixels).

也许不是使用RenderTargetBitmap?有没有办法?

Maybe not using RenderTargetBitmap? are there alternatives?

请注意:最终的存储目标是一个文件,或者是有损.jpg或一个losseless巴纽

NOTE: The final store target is a file, either a lossy .jpg or a losseless .png.

推荐答案

20000点¯x20000像素= 4亿个像素。时报每像素4个字节= 1.5 GB(uncom pressed数据)

20000 x 20000 pixels = 400000000 pixels. Times 4 bytes per pixel = 1.5 Gb (uncompressed data)

这简直是太大了。

我想创建多个图像,它们拼接或使用更小的图像,并将其用作瓷砖。

I'd create multiple images and stitch them or use even smaller images and use them as tiles.

这篇关于如何创建与RenderTargetBitmap大位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆