Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Convert RenderTargetBitmap to WriteableBitmap
WhatsApp
Charwaka Thupili
Nov 13
2015
5.5
k
0
0
var bitmap =
new
RenderTargetBitmap();
await bitmap.RenderAsync(Cam);
//Cam is your Gird
var pixelBuffer = await bitmap.GetPixelsAsync();
byte
[] pixels = pixelBuffer.ToArray();
var wb =
new
WriteableBitmap((
int
) bitmap.PixelWidth, (
int
) bitmap.PixelHeight);
using
(Stream stream = wb.PixelBuffer.AsStream())
{
await stream.WriteAsync(pixels, 0, pixels.Length);
}
RenderTargetBitmap
WriteableBitmap
Convert RenderTargetBitmap to WriteableBitmap
windows 10
winrt
windows phone 8.1
Up Next
How to Convert RenderTargetBitmap to WriteableBitmap