<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>WriteableBitmapEx Discussions Rss Feed</title><link>http://writeablebitmapex.codeplex.com/Thread/List.aspx</link><description>WriteableBitmapEx Discussions Rss Description</description><item><title>New Post: Resizing Image distorts its pixels around corners</title><link>http://writeablebitmapex.codeplex.com/discussions/444207</link><description>&lt;div style="line-height: normal;"&gt;Hi!&lt;br /&gt;
&lt;br /&gt;
I needed to resize an image so I used following code:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;            WriteableBitmap img2 = new WriteableBitmap((int)width, (int)height);
            img2 = img.Resize((int)width, (int)height, WriteableBitmapExtensions.Interpolation.Bilinear);
destination.Blit(new Rect(coords.X, coords.Y, img2.PixelWidth, img2.PixelHeight), img2, new Rect(0,0, img2.PixelWidth, img2.PixelHeight));
            return destination;&lt;/code&gt;&lt;/pre&gt;

But when i save this destination image it becomes distorted around the edges and gives me this image:&lt;br /&gt;
&lt;img src="http://www.flickr.com/photos/67703456@N04/8753994141/in/photostream" alt="Image" /&gt;&lt;br /&gt;
&lt;br /&gt;
Any ideas for what can be wrong here?&lt;br /&gt;
&lt;/div&gt;</description><author>Tehreem</author><pubDate>Sun, 19 May 2013 19:00:13 GMT</pubDate><guid isPermaLink="false">New Post: Resizing Image distorts its pixels around corners 20130519070013P</guid></item><item><title>New Post: Resize from byte array - What am I doing wrong here?</title><link>http://writeablebitmapex.codeplex.com/discussions/443591</link><description>&lt;div style="line-height: normal;"&gt;This worked for me!!!!  Instead of ToByteArray or ToArray:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    public static byte[] ReadBytesFromStream(MemoryStream stream1)
    {
        MemoryStream stream = new MemoryStream(stream1.ToArray());
        byte[] size = new byte[16 * 1024];
        using (MemoryStream memoryStream = new MemoryStream())
        {
            int readCount;
            while ((readCount = stream.Read(size, 0, size.Length)) &amp;gt; 0)
            {
                memoryStream.Write(size, 0, readCount);
            }
            return memoryStream.ToArray();
        }
    } &lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>kevinfu</author><pubDate>Tue, 14 May 2013 19:17:02 GMT</pubDate><guid isPermaLink="false">New Post: Resize from byte array - What am I doing wrong here? 20130514071702P</guid></item><item><title>New Post: Resize from byte array - What am I doing wrong here?</title><link>http://writeablebitmapex.codeplex.com/discussions/443591</link><description>&lt;div style="line-height: normal;"&gt;Now I am trying an encoder but when I save that image to SQL Server, it saves a purple splotchy image, even when I don't use resize.&lt;br /&gt;
&lt;br /&gt;
However, I am still using ToByteArray (or ToArray) to save it to the database after encoding to JPEG.  Is there something I can use instead to save the stream as a byte array into the database?&lt;br /&gt;
&lt;/div&gt;</description><author>kevinfu</author><pubDate>Tue, 14 May 2013 16:04:59 GMT</pubDate><guid isPermaLink="false">New Post: Resize from byte array - What am I doing wrong here? 20130514040459P</guid></item><item><title>New Post: Resize from byte array - What am I doing wrong here?</title><link>http://writeablebitmapex.codeplex.com/discussions/443591</link><description>&lt;div style="line-height: normal;"&gt;The ToByteArray is a raw ARGB stream, so really big and can only be read via the FromByteArray method. &lt;br /&gt;
You should encode the image as JPEG, after the resize. Different platforms have different ways how to accomplish this. &lt;br /&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Tue, 14 May 2013 15:20:10 GMT</pubDate><guid isPermaLink="false">New Post: Resize from byte array - What am I doing wrong here? 20130514032010P</guid></item><item><title>New Post: Resize from byte array - What am I doing wrong here?</title><link>http://writeablebitmapex.codeplex.com/discussions/443591</link><description>&lt;div style="line-height: normal;"&gt;byte[] m_Bytes = ReadToEnd(fileStream);  //converts fileStream to byte array - this works&lt;br /&gt;
WriteableBitmap bmp1 = new WriteableBitmap(166, 166); &lt;br /&gt;
bmp1.FromByteArray(m_Bytes); &lt;br /&gt;
WriteableBitmap resizedImage = bmp1.Resize(25, 25, WriteableBitmapExtensions.Interpolation.Bilinear); &lt;br /&gt;
byte[] buffer1 = resizedImage.ToByteArray();  //if I use bmp1 here, the code works fine&lt;br /&gt;
CurrentOrder.CompanyImage = buffer1;  //saves an unreadable byte array in the DB&lt;br /&gt;
&lt;/div&gt;</description><author>kevinfu</author><pubDate>Tue, 14 May 2013 13:09:29 GMT</pubDate><guid isPermaLink="false">New Post: Resize from byte array - What am I doing wrong here? 20130514010929P</guid></item><item><title>New Post: save PNG (transparent picture)</title><link>http://writeablebitmapex.codeplex.com/discussions/274445</link><description>&lt;div style="line-height: normal;"&gt;Hi, &lt;br /&gt;
&lt;br /&gt;
Can you please advise how I should use the code, such that when I save a png file on a windows 7 machine, I can open the png file in any image editor on the machine.  Currently I can save silverlight writeablebitmap in a png file, and see the image in NT explorer but not in other applications.&lt;br /&gt;
&lt;/div&gt;</description><author>piyagr01</author><pubDate>Thu, 09 May 2013 01:23:11 GMT</pubDate><guid isPermaLink="false">New Post: save PNG (transparent picture) 20130509012311A</guid></item><item><title>New Post: Rendering ink strokes into canvas element of datatemplate in gridview</title><link>http://writeablebitmapex.codeplex.com/discussions/442661</link><description>&lt;div style="line-height: normal;"&gt;Hi Experts,&lt;br /&gt;
&lt;br /&gt;
I am trying to render the strokes into the canvas element of a datatemplate in gridview.&lt;br /&gt;
&lt;br /&gt;
Can any one help me please?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance.&lt;br /&gt;
&lt;/div&gt;</description><author>Vinay789</author><pubDate>Mon, 06 May 2013 10:39:37 GMT</pubDate><guid isPermaLink="false">New Post: Rendering ink strokes into canvas element of datatemplate in gridview 20130506103937A</guid></item><item><title>New Post: Error while reading IRandomAccessStream to Byte array</title><link>http://writeablebitmapex.codeplex.com/discussions/441286</link><description>&lt;div style="line-height: normal;"&gt;Use the FromStream method.&lt;br /&gt;
&lt;a href="https://writeablebitmapex.codeplex.com/discussions/440934" rel="nofollow"&gt;https://writeablebitmapex.codeplex.com/discussions/440934&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Tue, 23 Apr 2013 15:57:35 GMT</pubDate><guid isPermaLink="false">New Post: Error while reading IRandomAccessStream to Byte array 20130423035735P</guid></item><item><title>New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging</title><link>http://writeablebitmapex.codeplex.com/discussions/441161</link><description>&lt;div style="line-height: normal;"&gt;Can you please try one of the Blit samples you can download from the source code repo? They use BlendMode and it works.&lt;br /&gt;
&lt;a href="https://writeablebitmapex.codeplex.com/SourceControl/BrowseLatest" rel="nofollow"&gt;https://writeablebitmapex.codeplex.com/SourceControl/BrowseLatest&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Tue, 23 Apr 2013 15:56:23 GMT</pubDate><guid isPermaLink="false">New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging 20130423035623P</guid></item><item><title>New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging</title><link>http://writeablebitmapex.codeplex.com/discussions/441161</link><description>&lt;div style="line-height: normal;"&gt;&lt;img src="http://i1292.photobucket.com/albums/b563/MafInTheDales/Capture_zps2e196c4a.png" alt="Image" /&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>mafinthedales</author><pubDate>Tue, 23 Apr 2013 15:13:31 GMT</pubDate><guid isPermaLink="false">New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging 20130423031331P</guid></item><item><title>New Post: Error while reading IRandomAccessStream to Byte array</title><link>http://writeablebitmapex.codeplex.com/discussions/441286</link><description>&lt;div style="line-height: normal;"&gt;I am getting the following error while reading IRandomAccessStream to Byte Array&lt;br /&gt;
&lt;br /&gt;
The operation attempted to access data outside the valid range.&lt;br /&gt;
&lt;br /&gt;
Can any one help me please?&lt;br /&gt;
&lt;/div&gt;</description><author>Vinay789</author><pubDate>Tue, 23 Apr 2013 12:36:07 GMT</pubDate><guid isPermaLink="false">New Post: Error while reading IRandomAccessStream to Byte array 20130423123607P</guid></item><item><title>New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging</title><link>http://writeablebitmapex.codeplex.com/discussions/441161</link><description>&lt;div style="line-height: normal;"&gt;Tried that :(&lt;br /&gt;
&lt;/div&gt;</description><author>mafinthedales</author><pubDate>Tue, 23 Apr 2013 07:59:56 GMT</pubDate><guid isPermaLink="false">New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging 20130423075956A</guid></item><item><title>New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging</title><link>http://writeablebitmapex.codeplex.com/discussions/441161</link><description>&lt;div style="line-height: normal;"&gt;Try a full qualified name with the namespace for blend mode.&lt;br /&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Mon, 22 Apr 2013 15:26:16 GMT</pubDate><guid isPermaLink="false">New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging 20130422032616P</guid></item><item><title>New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging</title><link>http://writeablebitmapex.codeplex.com/discussions/441161</link><description>&lt;div style="line-height: normal;"&gt;Hi.. Just started playing with your extensions but I get the error above when I add a blending mode to the Blit function.&lt;br /&gt;
&lt;br /&gt;
If I search for it in object browser I see two WriteableBitmapExtensions listed.  Is this what is causing the problem do you think?&lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;
&lt;/div&gt;</description><author>mafinthedales</author><pubDate>Mon, 22 Apr 2013 14:41:52 GMT</pubDate><guid isPermaLink="false">New Post: WriteableBitmapExtensions is ambiguous in the namespace System.Windows.Media.Imaging 20130422024152P</guid></item><item><title>New Post: AccessViolationException when accessing pixel color (GetPixel())</title><link>http://writeablebitmapex.codeplex.com/discussions/440934</link><description>&lt;div style="line-height: normal;"&gt;You're right, thank you. I changed the code and now it works well.&lt;br /&gt;
&lt;/div&gt;</description><author>Branyac</author><pubDate>Sat, 20 Apr 2013 16:30:24 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException when accessing pixel color (GetPixel()) 20130420043024P</guid></item><item><title>New Post: Simple image blitting/compositing with a background image and a foreground image.</title><link>http://writeablebitmapex.codeplex.com/discussions/431600</link><description>&lt;div style="line-height: normal;"&gt;Hey guys,&lt;br /&gt;
&lt;br /&gt;
I am waiting for your reply.&lt;br /&gt;
&lt;br /&gt;
Please its urgent.!!!!:(&lt;br /&gt;
&lt;/div&gt;</description><author>Vinay789</author><pubDate>Sat, 20 Apr 2013 09:30:00 GMT</pubDate><guid isPermaLink="false">New Post: Simple image blitting/compositing with a background image and a foreground image. 20130420093000A</guid></item><item><title>New Post: AccessViolationException when accessing pixel color (GetPixel())</title><link>http://writeablebitmapex.codeplex.com/discussions/440934</link><description>&lt;div style="line-height: normal;"&gt;You are using it wrong. The WinRT's SetSource will not load it right away, so when you access a pixel the buffer is not filled. Just check PixelWidth and PixelHeight &lt;br /&gt;
&lt;br /&gt;
That's why WBX has the FromStrean extension method:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;var tmpImage = await BitmapFactory.New(1, 1).FromStream(memoryStream);&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Rene&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Fri, 19 Apr 2013 18:29:39 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException when accessing pixel color (GetPixel()) 20130419062939P</guid></item><item><title>New Post: AccessViolationException when accessing pixel color (GetPixel())</title><link>http://writeablebitmapex.codeplex.com/discussions/440934</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I'm using WriteableBitmapEx to edit an image taken with tablet's cam with Windows 8 Pro but I got an AccessViolationException every time I try to get a pixel color value, here's the code:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Windows.Media.Capture.MediaCapture captureMgr = new MediaCapture();
await captureMgr.InitializeAsync();

IRandomAccessStream memoryStream = new InMemoryRandomAccessStream();
await captureMgr.CapturePhotoToStreamAsync(imageProperties, memoryStream);
await memoryStream.FlushAsync();
memoryStream.Seek(0);

WriteableBitmap tmpImage = new WriteableBitmap(1, 1); 
tmpImage.SetSource(memoryStream);
tmpImage.GetPixel(1, 1); // An AccessViolationException occurs.&lt;/code&gt;&lt;/pre&gt;

What I'm doing wrong? Or maybe a library bug?&lt;br /&gt;
&lt;/div&gt;</description><author>Branyac</author><pubDate>Fri, 19 Apr 2013 16:02:12 GMT</pubDate><guid isPermaLink="false">New Post: AccessViolationException when accessing pixel color (GetPixel()) 20130419040212P</guid></item><item><title>New Post: Bliting two WriteableBitmap with WriteableBitmapEx</title><link>http://writeablebitmapex.codeplex.com/discussions/440730</link><description>&lt;div style="line-height: normal;"&gt;All WriteableBitmapEx algorithms rely on the Pbgra32 format, so all your bitmaps have to use that format.&lt;br /&gt;
&lt;/div&gt;</description><author>teichgraf</author><pubDate>Thu, 18 Apr 2013 15:10:07 GMT</pubDate><guid isPermaLink="false">New Post: Bliting two WriteableBitmap with WriteableBitmapEx 20130418031007P</guid></item><item><title>New Post: Bliting two WriteableBitmap with WriteableBitmapEx</title><link>http://writeablebitmapex.codeplex.com/discussions/440730</link><description>&lt;div style="line-height: normal;"&gt;Thank you Rene.&lt;br /&gt;
&lt;br /&gt;
One more question.&lt;br /&gt;
Now I understand the problem. However, if I want to the output writeablebitmap as a Bgr32 one. Is there any way to convert _imageFrame to blit?&lt;br /&gt;
Adam&lt;br /&gt;
&lt;/div&gt;</description><author>AdamAiken</author><pubDate>Thu, 18 Apr 2013 14:22:52 GMT</pubDate><guid isPermaLink="false">New Post: Bliting two WriteableBitmap with WriteableBitmapEx 20130418022252P</guid></item></channel></rss>