I’ve been wanting to build a sample that spotlights Silverlight 3’s new SaveFileDialog, but I wanted the sample to actually do something. So I built a Silverlight app that lets you load photos, remove red eyes, and save the edited photos back to disk in PNG format. Silverlight 3’s new WriteableBitmap class provides the pixel-addressable API needed to manipulate onscreen images, and, of course, SaveFileDialog makes it possible to write modified images to the local file system.
The red-eye removal algorithm that I used is a simple one, but it’s surprisingly effective. Here’s an old picture of my kids with some very obnoxious red eyes loaded into the app:
And here’s how the same picture looks with the red eyes removed:
To fix a red eye, you simply drag a selection rectangle around it with the left mouse button held down. Fix as many as you want and then click the Save button to display a SaveFileDialog.
It’s amazing how far Web apps have come in the last year or two; imagine trying to write an app like this before the advent of RIAs.
WriteableBitmap makes it relatively simple to generate or modify images in Silverlight 3, but one feature Silverlight still lacks is an image encoder. There’s nothing built into Silverlight, for example, to generate a JPG or PNG from a WriteableBitmap. To compensate, I used Joe Stegman’s PNG Encoder. Joe’s encoder works very well, but it outputs uncompressed images. Consequently, the image files you save to disk are typically much larger than the ones you loaded. In addition, Joe’s encoder supports a maximum image size of 2,047 x 2,047, so I display an error message if you try to load anything larger.
You can try the app online, or you can download the source code. Kudos to the Silverlight team for adding SaveFileDialog and WriteableBitmap to the platform!
Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…
Cloud management is difficult to do manually, especially if you work with multiple cloud…
Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…
https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…
FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…
Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…
View Comments
I was wondering if it's possible in Silveright that the height of an object (in your case the green platform) is also automatically resized with the browser window?
Thank you for submitting this cool story - Trackback from DotNetShoutout
Thank you for submitting this cool story - Trackback from NewsPeeps
Finasteride. Propecia finasteride.
Generic Viagra Online Pharmacy No Prescription
USChemistoncall.com offers generic Viagra online and
thousands of online pharmacy no prescription drugs
including generic Cialis and generic Levitra. We
offer you a wide assortment of generic Viagra drugs
of high quality. In our catalog you will find a lot
of cheap Viagra medicines like: Viagra Soft Tabs
50mg, Viagra Soft Tabs 100mg, Viagra Citrate 50mg,
Viagra Citrate 100mg, Viagra Oral Jelly 100mg.You get
exactly what you are looking for top quality drugs,
lowest prices, fast shipping and guaranteed
satisfaction! Generic Viagra Online Pharmacy No
Prescription
Generic Viagra online is by far the most popular and
trusted ED medication on the market. A professional
Online Pharmacy with no prescription drugstore, we
are proud to be able to bring you our wide selection
of medicines. Buy cheap generic Viagra sildenafil
citrate, kamagra 100mg, generic levitra, kamagra oral
jelly, apcalis oral jelly, forzest, caverta or order
tadalis sx online for Erectile Dysfunction. We have
the lowest prices for all generic drugs Viagra with
no prescription, you can order online without
hesitation, as we make sure to provide
confidentiality and security in every transaction.
This company distributes generic drugs including
cheap Generic Viagra and Generic Cialis. It is a best
buy because you can save up to 70% from buying the
branded drugs. Much more buying online is the cheaper
than other offline outlet. Therefore, we advise you
to please make certain that you consult with your
trusted physician before trying to buy cheap generic
Viagra order online.
Our medications are generic branded and constitute
the real patented ones being absolutely equivalent in
ingredients. Are you looking for generic Viagra
online without prescription or any other drugs with
no prescription needed? You are in the right place!
Uschemistoncall.com is Generic Online Pharmacy with
wide variety of prescription drugs and here you can
buy Viagra online.
Link for download is not working. Can you fix it.