Saturday, 15 August 2015

windows phone 8 - Text in encoded PNG or JPEG blurry after encoding from RenderTargetBitmap -


I was trying to create a PNG file from a canvas. An image canvas and three Tekstblons was also aimed at allowing to move around the user's text block canvas, and then save the screenshot in a photo.

The captured image looks ok To capture on canvas I use Rendertaijet bitmap I but once I tried to change RenderTargetBitmap encode the PNG or JPEG, text becomes blurry

Here is the original image :.

Image details recorded on

Here's the code I used Goes:

prefix pixels = wait ArrangePicturePage. ArrangedImage.GetPixelsAsync (); Byte [] bytes = pixel .oerere (); IRandomAccessStream stream = new InMemoryRandomAccessStream (); BitmapEncoder encoder = wait BitmapEncoder.CreateAsync (BitmapEncoder.JpegEncoderId, stream); encoder.SetPixelData (BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, (uint) ArrangePicturePage.ArrangedImage.PixelHeight, (uint) ArrangePicturePage.ArrangedImage.PixelWidth, 96.0, 96.0, bytes); Wait for the encoder. Flush async (); Byte [] resulting buffer = new byte [stream.Size]; Wait for the stream. ReedSync (resulting buffer. Asbuffer (), (UIT) resulting buffer, length, inputstream option .a);

The resultant buffer is a blob that I think is PNG or JPEG. It looks like this:

here

there is something wrong with my conversion obscures the code that text?

After

You can control the compression by seting but you pass near.

Customize the default setting for quality display. If you need quality quality, then you can use it in BitMap Interface mode. Can strike in the trunk.


No comments:

Post a Comment