Using FJCore to encode Silverlight WriteableBitmap?

Figured it out! I downloaded FJCore from code.google. Com and went through the image class.It only expects the RGB bytes.

Here is the function that I wrote. I need the base64 version of the image so that's what my function returns.

Figured it out! I downloaded FJCore from code.google. Com and went through the image class.It only expects the RGB bytes.

Here is the function that I wrote. I need the base64 version of the image so that's what my function returns. Private static string GetBase64Jpg(WriteableBitmap bitmap) { int width = bitmap.

PixelWidth; int height = bitmap. PixelHeight; int bands = 3; byte, raster = new bytebands,; for (int I = 0; I > 16); raster1column, row = (byte)(pixel >> 8); raster2column, row = (byte)pixel; } } ColorModel model = new ColorModel { colorspace = ColorSpace. RGB }; FluxJpeg.Core.

Image img = new FluxJpeg.Core. Image(model, raster); MemoryStream stream = new MemoryStream(); JpegEncoder encoder = new JpegEncoder(img, 90, stream); encoder.Encode(); stream. Seek(0, SeekOrigin.

Begin); byte binaryData = new Bytestream. Length; long bytesRead = stream. Read(binaryData, 0, (int)stream.

Length); string base64String = System.Convert. ToBase64String(binaryData, 0, binaryData. Length); return base64String; }.

Hope you don't mind but I have used your code sample and extend it in to a full article see: blog.blueboxes.co. Uk/2009/07/21/… and attributed you correctly as under the CC licence – John Jul 21 '09 at 19:53 No problem. Glad someone is benefiting from this.

– RHLopez Jul 21 '09 at 20:49.

Sounds like n should be the byte-array of the image, I have been looking into encoding WriteableBitmap into a JPEG and found the same library but have not looked into it in detail, but assume this would be the case, will add more later to this answer to see if this works, as I have not have the chance to try it yet. There will be some method to get the bytes of a WritableBitmap in Silverlight I guess as it is possible to save to other types.

This code is fine and it should work. I am using same code to send image stream to server via web service and than regenerate image using these bytes...you can save these bytes to Db also WebMethod public string SaveImage(string data, string fileName) { byte imageBytes = System.Convert. FromBase64String(data); MemoryStream mem = new MemoryStream(); mem.

Write(imageBytes, 0, imageBytes. Length); System.Drawing. Image img = System.Drawing.Image.

FromStream(mem); img. Save("D:\\FinalTest. Jpg"); return "Saved!"; }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions