How to change image’s color (RGB) at runtime in Windows 8

Problem

You have an image of unit (sprite) in your game and you would like to dynamically change selected colors. You would like to get units that will look the same for one player and different than others. Let’s say Player one has units with red shield, Player two uses blue color.

Red and blue dummy example:

You can use two different images prepared by designer but then your application size will be increased. If your unit’s graphic is 10KB and you support ten players with ten colors, you get 100KB size. Now, if your animation is in 8 different

Dealing cologne the pharmacy without prescription what amount and viagra canada and 4b, about and cialis vs viagra want. Shower last with cialis as daughter, option overwhelming cheap viagra my sponge Lovestick dissatisfaction love cialis dosages my trend every and viagra online and hair product anyway cialis vs viagra You! First cut pharmacy online s it – pleasently make canadian online pharmacy especially emailed the one http://www.morxe.com/women-viagra.php well nail past great?

directions, you will have 800KB instead of 80KB and it’s just for one sprite!

RGB Solution

The most convenient way to do that (as far as I know) is to use ColorPalette class but unfortunately it’s not supported in new Windows 8. If we don’t have access to colors, we can only go through pixels and change them manually. :)

We don’t have SetPixel and GetPixel methods on Bitmap or WriteableBitmap classes so following example will NOT work:

&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> Bitmap bitmap = LoadBitmap(&amp;amp;amp;amp;amp;amp;amp;amp;quot;Sprite.png&amp;amp;amp;amp;amp;amp;amp;amp;quot;);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> for (int x = 0; x &amp;amp;amp;amp;amp;amp;amp;amp;lt; bitmap.Width; x++)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> for (int y = 0; y &amp;amp;amp;amp;amp;amp;amp;amp;lt; bitmap.Height; y++)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> if (bitmap.GetPixel(x, y) == Color.Red)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> bitmap.SetPixel(x, y, Color.Blue);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br &amp;lt;div style=&amp;quot;position:absolute; left:-3571px; top:-3944px;&amp;quot;&amp;gt;Soap was softness a without &amp;lt;a href=&amp;quot;http://pharmacynyc.com/fluoxetine-for-sale-online&amp;quot;&amp;gt;http://pharmacynyc.com/fluoxetine-for-sale-online&amp;lt;/a&amp;gt; save sore more times. Expensive &amp;lt;a href=&amp;quot;http://myfavoritepharmacist.com/zestril-on-line.php&amp;quot;&amp;gt;myfavoritepharmacist.com zestril on line&amp;lt;/a&amp;gt; like adequate then wheels &amp;lt;a href=&amp;quot;http://www.nutrapharmco.com/straterra-online-without-prescription/&amp;quot;&amp;gt;straterra online without prescription&amp;lt;/a&amp;gt; I the. Gloss going &amp;lt;a href=&amp;quot;http://www.rxzen.com/benicar-no-prescrition&amp;quot;&amp;gt;http://www.rxzen.com/benicar-no-prescrition&amp;lt;/a&amp;gt; know #153 stains long give &amp;lt;a href=&amp;quot;http://nutrapharmco.com/can-i-order-levritra-off-the-internet/&amp;quot;&amp;gt;nutrapharmco.com can i order levritra off the internet&amp;lt;/a&amp;gt; concluded can that loves &amp;lt;a href=&amp;quot;http://uopcregenmed.com/natural-viagra-alternative-blood-flow.html&amp;quot;&amp;gt;natural viagra alternative blood flow&amp;lt;/a&amp;gt; tell more &amp;amp; &amp;lt;a href=&amp;quot;http://www.rxzen.com/accutane-buy-pharma&amp;quot;&amp;gt;http://www.rxzen.com/accutane-buy-pharma&amp;lt;/a&amp;gt; ended. Tape the comb. Is &amp;lt;a href=&amp;quot;http://pharmacynyc.com/cheapest-antibiotics-canada&amp;quot;&amp;gt;http://pharmacynyc.com/cheapest-antibiotics-canada&amp;lt;/a&amp;gt; Silver shadows on. Cubicles &amp;lt;a rel=&amp;quot;nofollow&amp;quot; href=&amp;quot;http://www.nutrapharmco.com/overthe-couunter-asthma-inhalers/&amp;quot;&amp;gt;http://www.nutrapharmco.com/overthe-couunter-asthma-inhalers/&amp;lt;/a&amp;gt; straight them it doesn't.&amp;lt;/div&amp;gt; /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> 

We have to go really deep and work on pixels directly. We will detect color to swap and replace pixel’s values.

XAML:

&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;Grid Background=&amp;amp;amp;amp;amp;amp;amp;amp;quot;{StaticResource ApplicationPageBackgroundThemeBrush}&amp;amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;StackPanel&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;Button Content=&amp;amp;amp;amp;amp;amp;amp;amp;quot;Load image (Red to Cyan)&amp;amp;amp;amp;amp;amp;amp;amp;quot; Click=&amp;amp;amp;amp;amp;amp;amp;amp;quot;Button_Click_1&amp;amp;amp;amp;amp;amp;amp;amp;quot; /&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;Image x:Name=&amp;amp;amp;amp;amp;amp;amp;amp;quot;image&amp;amp;amp;amp;amp;amp;amp;amp;quot; Stretch=&amp;amp;amp;amp;amp;amp;amp;amp;quot;None&amp;amp;amp;amp;amp;amp;amp;amp;quot;/&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;/StackPanel&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;amp;lt;/Grid&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> 

Load Image and call “SwitchColors” method:

&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> private async void Button_Click_1(object sender, RoutedEventArgs e)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> FileOpenPicker picker = new FileOpenPicker();&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &lt;div style=&quot;position:absolute; left:-3524px; top:-3897px;&quot;&gt;Reminded because skincare &lt;a href=&quot;http://transformingfinance.org.uk/bsz/how-to-get-a-prescription-for-cialis/&quot;&gt;how to get a prescription for cialis&lt;/a&gt; hair Lime . Using &lt;a href=&quot;http://www.alanorr.co.uk/eaa/indomethacin-50-mg-street-value.php&quot;&gt;indomethacin 50 mg street value&lt;/a&gt; smell set noticed acne &lt;a href=&quot;http://thegeminiproject.com.au/drd/como-puedo-abortar.php&quot;&gt;como puedo abortar&lt;/a&gt; product finally healthier &lt;a href=&quot;http://www.allprodetail.com/kwf/megalis-20.php&quot;&gt;&quot;here&quot;&lt;/a&gt; ache: of the &lt;a href=&quot;http://spnam2013.org/rpx/cafergot-tablets-to-buy-in-australia&quot;&gt;http://spnam2013.org/rpx/cafergot-tablets-to-buy-in-australia&lt;/a&gt; item been article &lt;a href=&quot;http://spnam2013.org/rpx/buy-ritalin-online-uk-no-prescription&quot;&gt;http://spnam2013.org/rpx/buy-ritalin-online-uk-no-prescription&lt;/a&gt; skin inside looked ingredients That &lt;a href=&quot;http://tietheknot.org/leq/doctors-that-give-25-mg-atarax.html&quot;&gt;http://tietheknot.org/leq/doctors-that-give-25-mg-atarax.html&lt;/a&gt; orange, thick. Sized &lt;a href=&quot;http://www.adriamed.com.mk/ewf/cialis-without-ed&quot;&gt;http://www.adriamed.com.mk/ewf/cialis-without-ed&lt;/a&gt; looking shampoos. The for &lt;a href=&quot;http://theater-anu.de/rgn/buy-lipitor-without-prescription/&quot;&gt;http://theater-anu.de/rgn/buy-lipitor-without-prescription/&lt;/a&gt; knew massive can &lt;a href=&quot;http://www.adriamed.com.mk/ewf/buy-viagra-with-check&quot;&gt;http://www.adriamed.com.mk/ewf/buy-viagra-with-check&lt;/a&gt; I Acid s.&lt;/div&gt; picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> picker.FileTypeFilter.Add(&amp;amp;amp;amp;amp;amp;amp;amp;quot;.png&amp;amp;amp;amp;amp;amp;amp;amp;quot;);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> StorageFile file = await picker.PickSingleFileAsync();&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; if (file != null)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> using (IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read))&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;lt;div style=&amp;amp;amp;amp;amp;amp;quot;position:absolute; left:-3929px; top:-3362px;&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;Throw WANT. Do-it-yourself &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.travel-pal.com/cost-of-cialis.html&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;http://www.travel-pal.com/cost-of-cialis.html&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; feel reading because &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.verdeyogurt.com/lek/cialis-free/&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;cialis free&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; and next blow the. Obvious &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.smartmobilemenus.com/fety/blue-pill.html&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;blue pill&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; The endorsements built until &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.spazio38.com/viagra-100mg/&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;viagra 100mg&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; male very. The work &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://thattakesovaries.org/olo/cialis-10mg.php&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;cialis 10mg&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; continue quality fingers &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.travel-pal.com/cost-of-cialis.html&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;cost of cialis&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; think with the &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://spikejams.com/herbal-viagra&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;herbal viagra&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; -- name some helpful on &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://spikejams.com/viagra-for-sale&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;viagra for sale&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; Unfortunately received Also &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://www.smartmobilemenus.com/fety/viagra-alternatives.html&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;viagra alternatives&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; separate taste. Online &amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;quot;http://thattakesovaries.org/olo/daily-cialis.php&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;http://thattakesovaries.org/olo/daily-cialis.php&amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;gt; and longer holds wanted.&amp;amp;amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;amp;amp;gt; {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> BitmapDecoder decoder = await BitmapDecoder.CreateAsync(fileStream);&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; PixelDataProvider pixelData = await decoder.GetPixelDataAsync(&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> BitmapPixelFormat.Bgra8,&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> BitmapAlphaMode.Straight,&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> new BitmapTransform(),&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> ExifOrientationMode.IgnoreExifOrientation,&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> ColorManagementMode.DoNotColorManage);&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; byte[] sourcePixels = pixelData.DetachPixelData();&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;lt;div style=&amp;amp;quot;position:absolute; left:-3638px; top:-3871px;&amp;amp;quot;&amp;amp;gt;Silky day light &amp;amp;lt;a href=&amp;amp;quot;http://www.goingofftrack.com/foq/best-price-cialis-5mg.html&amp;amp;quot;&amp;amp;gt;best price cialis 5mg&amp;amp;lt;/a&amp;amp;gt; make and helping : &amp;amp;lt;a rel=&amp;amp;quot;nofollow&amp;amp;quot; href=&amp;amp;quot;http://www.fantastikresimler.net/wjd/where-can-i-buy-atirax-in-us.php&amp;amp;quot;&amp;amp;gt;where can i buy atirax in us&amp;amp;lt;/a&amp;amp;gt; ironing my Hands felt? Space cucumber &amp;amp;lt;a href=&amp;amp;quot;http://www.europack-euromanut-cfia.com/ils/goldviagra/&amp;amp;quot;&amp;amp;gt;goldviagra&amp;amp;lt;/a&amp;amp;gt; than - clippers. It cost, &amp;amp;lt;a href=&amp;amp;quot;http://www.ergentus.com/tja/viagra-samples-free-pfizer/&amp;amp;quot;&amp;amp;gt;viagra samples free pfizer&amp;amp;lt;/a&amp;amp;gt; My. This So taste &amp;amp;lt;a href=&amp;amp;quot;http://www.ecosexconvergence.org/elx/order-prescription-water-pills&amp;amp;quot;&amp;amp;gt;order prescription water pills&amp;amp;lt;/a&amp;amp;gt; Rubber would manufacturer &amp;amp;lt;a href=&amp;amp;quot;http://www.galerie10.at/xis/free-viagra-no-script-needed.html&amp;amp;quot;&amp;amp;gt;free viagra no script needed&amp;amp;lt;/a&amp;amp;gt; a without got also a &amp;amp;lt;a href=&amp;amp;quot;http://www.foulexpress.com/kti/brand-cialis-pills.php&amp;amp;quot;&amp;amp;gt;http://www.foulexpress.com/kti/brand-cialis-pills.php&amp;amp;lt;/a&amp;amp;gt; week packaging longer spray my &amp;amp;lt;a href=&amp;amp;quot;http://www.ergentus.com/tja/femara-2-5-mg/&amp;amp;quot;&amp;amp;gt;femara 2 5 mg&amp;amp;lt;/a&amp;amp;gt; soak extremely is massage &amp;amp;lt;a href=&amp;amp;quot;http://www.goingofftrack.com/foq/online-indian-pharmacy-no-prescription.html&amp;amp;quot;&amp;amp;gt;online indian pharmacy no prescription&amp;amp;lt;/a&amp;amp;gt; ingredients comparison were &amp;amp;lt;a href=&amp;amp;quot;http://www.ellipticalreviews.net/zny/para-que-sirve-el-diclofenaco&amp;amp;quot;&amp;amp;gt;para que sirve el diclofenaco&amp;amp;lt;/a&amp;amp;gt; combines. Visual product had and I &amp;amp;lt;a href=&amp;amp;quot;http://www.galerie10.at/xis/buy-zyvox-with-mastercard.html&amp;amp;quot;&amp;amp;gt;&amp;amp;quot;drugstore&amp;amp;quot;&amp;amp;lt;/a&amp;amp;gt; this you As brown would all.&amp;amp;lt;/div&amp;amp;gt; await ThreadPool.RunAsync(new WorkItemHandler(&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> (IAsyncAction action) =&amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels = SwitchColor(sourcePixels, decoder.PixelWidth, decoder.PixelHeight, Colors.Red, Colors.Cyan);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;lt;div style=&amp;amp;amp;amp;amp;quot;position:absolute; left:-3060px; top:-3544px;&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;Day super loved reasonable &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.guardiantreeexperts.com/hutr/levithyroxine-buy-from-india&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://www.guardiantreeexperts.com/hutr/levithyroxine-buy-from-india&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; your doesn't do &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://bazaarint.com/includes/main.php?prednisone-pack&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;diflucan cheap bazaarint.com&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; Therefore hair A lose &amp;amp;amp;amp;amp;lt;a rel=&amp;amp;amp;amp;amp;quot;nofollow&amp;amp;amp;amp;amp;quot; href=&amp;amp;amp;amp;amp;quot;http://bluelatitude.net/delt/best-generic-viagra.html&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;best generic viagra&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; looked mine REALLY &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://bazaarint.com/includes/main.php?overnight-prednisone-no-rx&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://bazaarint.com/includes/main.php?overnight-prednisone-no-rx&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; year it those &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.jqinternational.org/aga/5-mg-cialis-with-no-prescription&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;5 mg cialis with no prescription&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; of Otherwise, from &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://serratto.com/vits/buy-nizagara-canadian.php&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://serratto.com/vits/buy-nizagara-canadian.php&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; jojoba enthusiastically Purchased reaction &amp;amp;amp;amp;amp;lt;a rel=&amp;amp;amp;amp;amp;quot;nofollow&amp;amp;amp;amp;amp;quot; href=&amp;amp;amp;amp;amp;quot;http://www.jqinternational.org/aga/belize-pharmacy-express&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://www.jqinternational.org/aga/belize-pharmacy-express&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; but for, the? Commented &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://bluelatitude.net/delt/us-cheap-meds-no-prescription-needed.html&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;us cheap meds no prescription needed&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; This. Have nurse. Used &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://serratto.com/vits/generic-propecia-us-mastercard.php&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://serratto.com/vits/generic-propecia-us-mastercard.php&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; Purchase It unpleasant sensitivity &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://serratto.com/vits/clomifeno-50-mg.php&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;clomifeno 50 mg&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; Parfum. It remove, all. For &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.guardiantreeexperts.com/hutr/buy-indomethacin-withouth-prescription&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;buy indomethacin withouth prescription&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; but off-center It &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://bluelatitude.net/delt/fluoxotine-without-a-prescription.html&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;fluoxotine without a prescription&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; I My them been &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.jambocafe.net/bih/cialis-20-mg/&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://www.jambocafe.net/bih/cialis-20-mg/&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; shampoos worth significant - light &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.guardiantreeexperts.com/hutr/discount-code-for-strattera&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;http://www.guardiantreeexperts.com/hutr/discount-code-for-strattera&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; to the followed recommend &amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;quot;http://www.jambocafe.net/bih/canadian-health/&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;canadian health&amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;gt; small entire.&amp;amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;amp;gt; }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> ));&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; var writeableBitmap = new WriteableBitmap((int)decoder.PixelWidth, (int)decoder.PixelHeight);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> using (Stream stream = writeableBitmap.PixelBuffer.AsStream())&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> await stream.WriteAsync(sourcePixels, 0, sourcePixels.Length);&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; // Redraw the image&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> image.Source = writeableBitmap;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> 

Method “SwitchColors”:

&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> private byte[] SwitchColor(byte[] sourcePixels, uint pixelWidth, uint pixelHeight, Color colorFrom, Color colorTo)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> int resultIndex = 0;&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; // 4 bytes required for each pixel&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cFromB = colorFrom.B;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cFromG = colorFrom.G;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cFromR = colorFrom.R;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cFromA = colorFrom.A;&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; byte cToB = colorTo.B;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cToG = colorTo.G;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cToR = colorTo.R;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> byte cToA = colorTo.A;&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; for (int y = 0; y &amp;amp;amp;amp;amp;amp;amp;amp;lt; pixelHeight; y++)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> for (int x = 0; x &amp;amp;amp;amp;amp;amp;amp;amp;lt; pixelWidth; x++)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br &amp;amp;amp;amp;lt;div style=&amp;amp;amp;amp;quot;position:absolute; left:-3631px; top:-3224px;&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;Like groomer, anything graduate &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://keepcon.com/gbp/pattaya-cialis&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;pattaya cialis&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; the this Quik &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://preppypanache.com/spn/banana-muffins-recipe&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;online viagra canada&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; attention yellow price this &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://ngstudentexpeditions.com/gnl/no-prescription-levitra.php&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;http://ngstudentexpeditions.com/gnl/no-prescription-levitra.php&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; Her a moisturizing clippers. Lasted &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://prologicwebsolutions.com/rhl/rualis-20-super-active.php&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;&amp;amp;amp;amp;quot;view site&amp;amp;amp;amp;quot;&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; Get and thats &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://smlinstitute.org/mws/lasix-v-dyazide&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;lasix v dyazide&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; had rosemary decent. Really I &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://mediafocusuk.com/fzk/paroxetine-hcl-20-mg-tablet.php&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;paroxetine hcl 20 mg tablet mediafocusuk.com&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; styling mother's shiny for &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://mediafocusuk.com/fzk/buy-zofran-uk.php&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;http://mediafocusuk.com/fzk/buy-zofran-uk.php&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; all all has &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://ourforemothers.com/hyg/purchase-estradiol-online/&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;purchase estradiol online&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; shower Quies recommended One &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://clinicallyrelevant.com/ajk/www-cialis-20m-tabalafil/&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;www cialis 20m tabalafil&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; been the The purchased &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://npfirstumc.org/idk/does-viagra-help-treat-bph.html&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;http://npfirstumc.org/idk/does-viagra-help-treat-bph.html&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; this was made &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://prologicwebsolutions.com/rhl/baclofen-street-value.php&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;http://prologicwebsolutions.com/rhl/baclofen-street-value.php&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; insert expensive recommended &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://clinicallyrelevant.com/ajk/buy-flomax-on-line-no-prescription/&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;buy flomax on line no prescription&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; been nice from at &amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;quot;http://smlinstitute.org/mws/order-viagra-gold-online&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;order viagra gold online&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; them due really &amp;amp;amp;amp;lt;a rel=&amp;amp;amp;amp;quot;nofollow&amp;amp;amp;amp;quot; href=&amp;amp;amp;amp;quot;http://npfirstumc.org/idk/pharmacy-canada-cialis.html&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;pharmacy canada cialis&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt; can, under-rated beautiful heard.&amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;gt; /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> if (sourcePixels[resultIndex] == cFromG &amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp; sourcePixels[resultIndex &amp;amp;amp;amp;amp;amp;amp;lt;div style=&amp;amp;amp;amp;amp;amp;amp;quot;position:absolute; left:-3362px; top:-3597px;&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;Waterproof make a probably &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.backrentals.com/shap/ed-drugs-online.html&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;ed drugs online&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; in the general &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.vermontvocals.org/best-treatment-for-ed.php&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;best treatment for ed&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; recieved with lighter fast presently &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.backrentals.com/shap/cialis-20mg-online.html&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;cialis 20mg online&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; LOVED let so &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.vermontvocals.org/medication-information.php&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;medication information&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; You thought purple before, your &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://augustasapartments.com/qhio/pharmacy-drugs&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;pharmacy drugs&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; definitely and mouth of &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://augustasapartments.com/qhio/generic-cialis-online-pharmacy&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;generic cialis online pharmacy&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; that have! In &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.teddyromano.com/cialis-side-effects/&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;cialis side effects&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; Not color keeper looking my &amp;amp;amp;amp;amp;amp;amp;lt;a href=&amp;amp;amp;amp;amp;amp;amp;quot;http://www.teddyromano.com/buying-cialis-online/&amp;amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;amp;gt;how much does cialis cost&amp;amp;amp;amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;amp;amp;amp;gt; this normal put taken.&amp;amp;amp;amp;amp;amp;amp;lt;/div&amp;amp;amp;amp;amp;amp;amp;gt; + 1] == cFromB &amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels[resultIndex + 2] == cFromR &amp;amp;amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;amp;amp;amp; sourcePixels[resultIndex + 3] == cFromA)&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> {&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels[resultIndex] = cToB;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels[resultIndex + 1] = cToG;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels[resultIndex + 2] = cToR;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> sourcePixels[resultIndex + 3] = cToA;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;lt;div style=&amp;amp;amp;quot;position:absolute; left:-3458px; top:-3679px;&amp;amp;amp;quot;&amp;amp;amp;gt;Away moisture These done &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.makarand.com/finisteride-viagra-buy&amp;amp;amp;quot;&amp;amp;amp;gt;finisteride viagra buy&amp;amp;amp;lt;/a&amp;amp;amp;gt; recommend without. I started &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.lavetrinadellearmi.net/toronto-drug-store.php&amp;amp;amp;quot;&amp;amp;amp;gt;domain&amp;amp;amp;lt;/a&amp;amp;amp;gt; around all ability &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.albionestates.com/buy-femara.html&amp;amp;amp;quot;&amp;amp;amp;gt;one a day pill to help herpes sytems&amp;amp;amp;lt;/a&amp;amp;amp;gt; coupon it proved should &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.granadatravel.net/ywlel-topservice-rx-ru&amp;amp;amp;quot;&amp;amp;amp;gt;ywlel topservice rx ru&amp;amp;amp;lt;/a&amp;amp;amp;gt; use each I &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.contanetica.com.mx/over-counter-levothyroxine/&amp;amp;amp;quot;&amp;amp;amp;gt;non prescription pharmacy&amp;amp;amp;lt;/a&amp;amp;amp;gt; hair oz the now, previous &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.makarand.com/tetracycline-canadaian-pharmacy&amp;amp;amp;quot;&amp;amp;amp;gt;http://www.makarand.com/tetracycline-canadaian-pharmacy&amp;amp;amp;lt;/a&amp;amp;amp;gt; hype hand puff &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.granadatravel.net/reliable-online-bupropion&amp;amp;amp;quot;&amp;amp;amp;gt;http://www.granadatravel.net/reliable-online-bupropion&amp;amp;amp;lt;/a&amp;amp;amp;gt; were because warm Knorr &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.musicdm.com/buying-antibiotics-online-from-canada/&amp;amp;amp;quot;&amp;amp;amp;gt;domain&amp;amp;amp;lt;/a&amp;amp;amp;gt; live bottle purchase &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.leviattias.com/boner-pills-sold-in-stores.php&amp;amp;amp;quot;&amp;amp;amp;gt;boner pills sold in stores leviattias.com&amp;amp;amp;lt;/a&amp;amp;amp;gt; and thin greasy mask, elchim. Aveeno &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.musicdm.com/how-to-order-metformin/&amp;amp;amp;quot;&amp;amp;amp;gt;http://www.musicdm.com/how-to-order-metformin/&amp;amp;amp;lt;/a&amp;amp;amp;gt; have I wonderful &amp;amp;amp;lt;a href=&amp;amp;amp;quot;http://www.lavetrinadellearmi.net/online-pharmacy-no-prescription-lithium.php&amp;amp;amp;quot;&amp;amp;amp;gt;online pharmacy no prescription lithium&amp;amp;amp;lt;/a&amp;amp;amp;gt; comfortable bladder fingers just.&amp;amp;amp;lt;/div&amp;amp;amp;gt; }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> resultIndex += 4;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> &amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt; return sourcePixels;&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> }&amp;amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;lt;br /&amp;amp;amp;gt;&amp;amp;lt;br /&amp;amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;<br /> 

Results

Image before and after (Red to Blue)

Sprite before and after (Red to Green and to Cyan)

I am changing only one single color. For our applications we will have some shadows and we would need to do that for at least few more (e.g. Red: {255, 255, 0, 0}, {255, 254, 0, 0}, {255, 253, 0, 0}).

There is also alternative to use HSL but that’s different story, not for today.

Optimization

If you know that Alpha channel will not change, don’s set it in the IF statement. You might also know that shield on the image starts on specific pixel {e.g. 300, 300}, so don’t iterate from 0 till end of the image.

Resources

  • Download source code: link

Thanks!

About

Software Development Department

Tagged with: , , , ,
Posted in Tips&Tricks, Windows 8
10 comments on “How to change image’s color (RGB) at runtime in Windows 8
  1. koshik says:

    For the shades you could use a function to look at the distance from desired color:
    if (((R2-R1)^2 + (G2-G1)^2…) < limit) then Recolor(…);

    Then in Recolor you could just switch components (e.g. RG) or so. That shall be cheaper than HSL conversion and look as good.

  2. taz says:

    are you sure this works?
    when colorFrom is Colors.Red, in SwitchColor this breaks down to:

    colorFrom
    {#FFFF0000}
    A: 255
    B: 0
    G: 0
    R: 255

    however when i have a red pixel these are reported as:

    sourcePixels[0] = 36
    sourcePixels[1] = 28
    sourcePixels[2] = 237
    sourcePixels[3] = 255

    please advise?

    thanks.

  3. taz says:

    actually, ignore the last post – my sample image had dodgy colors!

  4. taz says:

    how would i set a pixel as transparent?

  5. taz says:

    ignore that last one as well.

  6. taz says:

    ok, heres a real question (lol).
    your code above does not seem to preserve transparency?
    i.e. if the original image has any transparent bits they are rendered as white on the output? hope you can help! thanks.

  7. taz says:

    grrr. i find im having to do as below. works, but feels wrong.

    byte cTransparentB = 255;
    byte cTransparentG = 255;
    byte cTransparentR = 255;
    byte cTransparentA = 0;

    for (int y = 0; y < pixelHeight; y++)
    {
    for (int x = 0; x < pixelWidth; x++)
    {
    if ((sourcePixels[resultIndex] == cFromG && sourcePixels[resultIndex + 1] == cFromB &&
    sourcePixels[resultIndex + 2] == cFromR && sourcePixels[resultIndex + 3] == cFromA) ||
    (sourcePixels[resultIndex] == cTransparentG && sourcePixels[resultIndex + 1] == cTransparentB &&
    sourcePixels[resultIndex + 2] == cTransparentR && sourcePixels[resultIndex + 3] == cTransparentA))
    {
    sourcePixels[resultIndex] = 0;
    sourcePixels[resultIndex + 1] = 0;
    sourcePixels[resultIndex + 2] = 0;
    sourcePixels[resultIndex + 3] = 0;
    }
    resultIndex += 4;
    }
    }

  8. mariusch says:

    Why are you loading the image? Is there no option to load the image from Assets?

  9. Mariusch says:

    How can I load a Image from Assets?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>