Questions tagged [writablebitmap]

Provides a BitmapSource that can be written to and updated.

Provides a BitmapSource that can be written to and updated.

Namespace: System.Windows.Media.Imaging

Assembly: PresentationCore (in PresentationCore.dll)

References: MSDN

60 questions
1
vote
0 answers

UWP - load WritableBitmap from byte array returns weird image

I have an InkCanvas drawing, which i convert to WriteableBitmap and set is as an ImageSource as follows: MemoryStream ms = new MemoryStream(); await inkCanvas.InkPresenter.StrokeContainer.SaveAsync(ms.AsOutputStream()); ms.Position =…
J.Doe
  • 326
  • 2
  • 14
1
vote
1 answer

Drawing on a canvas using WriteableBitmap, C# WPF

hope you can help me. I'm trying to use the WriteableBitmap class to draw points on my canvas but nothing shows up on on execution I've had a look at similar issues but nothing seems to work. Here's my code;
James Morrison
  • 1,954
  • 2
  • 21
  • 48
1
vote
2 answers

Incorrect Byte[] from WriteableBitmap in C# UWP10

I want to get the base64 string from WriteableBitmap. I believe the byte[] to be incorrect. Because: The code for creating image from base64 is working. Tested this when sending base64 string from file. However i can't see anything when i'm using my…
1
vote
2 answers

Why AccessViolationException occurs when accessing pixels in WriteableBitmap Image?

I have a video stream from a camera to an Image in a WPF. I am trying to access the WritableBitMap Image pixel by pixel before displaying it. As a test I am trying to set the whole image to white or black. In both cases however, I get the…
Khalil Khalaf
  • 9,259
  • 11
  • 62
  • 104
1
vote
2 answers

How to use WriteableBitmap.setpixel() efficiently in windows 10 uwp?

I have a scenario where choosing a image file and then using BitmapDecoder converting the source to a WriteableBitmap and setting an image.source to the WriteableBitmap. Now when a user taps on the image I get the co-ordinates and then want to…
AbsoluteSith
  • 1,917
  • 25
  • 60
1
vote
1 answer

How to draw an arc on WritableBitmap + WritablebitmapEx

I'm drawing a lot of shapes on WritableBitmap with help of WritableBitmapEx in my WPF application. Unfortunately there is no ready to go function to draw an arc on it. How can I: 1. Draw an arc on WritableBitmap? 2. Draw an anti-aliased arc with…
vac
  • 693
  • 5
  • 23
1
vote
3 answers

Crop / Clip Images in WinRT

How I can Crop / Clip images in WinRT. I have an image filled completely in a windows 8 window. I need to clip / crop the image from center and i need to display the two image section into two separate grids. How I can do the same through windows 8.…
StezPet
  • 2,430
  • 2
  • 27
  • 49
1
vote
0 answers

Special character doesn't appear the same on windows phone emulator and real device

my problem is a bit strange!! I'm going to create a calendar tile with writable bitmap for windows phone 8. so I'm using this character "". I'm using the below code and everything works fine as I expected on emulator. but when I test my app on a…
1
vote
1 answer

How to convert WritableBitmap to Base64 string

In my application I am using WriteableBitmapRenderExtensions.Render() method present in WinRT XAML toolkit for rendering xaml element. After rendering the xaml control I need to send this to server in the form of Base64 string. How I can convert…
1
vote
1 answer

Save WritableBitmap to IsolatedStorageFileStream

Is there a simple way to save the contents of the variable WriteableBitmap to IsolatedStorageFile? I am writing a program that processes the pixels in a WriteableBitmap, and then saves the processed bitmap as file *.bmp and stores it in the…
1
vote
2 answers

WritePixels of WriteableBitmap in a Task

A little n00b question I still do not understand reading, many StackOverflow answers. The colorData variable is a byte array updated 25 times/s by Kinect. There is no UI Component. I thought WriteableBitmap and WritePixels was called in the same…
Jean-Philippe Encausse
  • 1,491
  • 2
  • 22
  • 40
1
vote
0 answers

Error when trying to merge two Pictures using WriteableBitMap

Basically I navigate to this page and pass it a name as a parameter, which I then use to retrieve that picture from isolated storage. At the same time I retrieve the "frame" from the assets folder. When I compile the code no error occurs, but once I…
0
votes
0 answers

C# from WritableBitmap to Image64 string conversion

I created some methods to generate plots in memory that provide a WritableBitmap that I was consuming in WPF controls. Now I need to show the same images in a Blazor app. I investigated, and it seems that the only way to do this in memory, with no…
javirs
  • 1,049
  • 26
  • 52
0
votes
1 answer

Converting arrays ushort[] to int[] using Buffer.BlockCopy

I'm trying to convert array type of ushort[4k*4k] of values 0-65k to similiar array type of int[] of same values. It seems to mee that Buffer.BlockCopy is the fastest way to do that. I'm trying the following code: ushort[] uPixels =…
0
votes
0 answers

How to convert from System.Drawing.Imaging.PixelFormat to System.Windows.Media.PixelFormat

I'm converting a Bitmap to WritableBitmap, but they both have many formats, I can't figure out the corresponding relations. I want to cover all convert conditions, so is there any official docs refer? private System.Windows.Media.PixelFormat…
Vincent
  • 3,124
  • 3
  • 21
  • 40