Silverlight |
Flash |
Silverlight Limitations: | |
Silverlight is missing Linux support, so people using Linux machine cannot run it on their machines and will have to stick to Windows and MAC OS. | This limitation doesn’t exist with Flash. |
Silverlight will (naturally) be using the WMV and Silverlight will add to the use of the WMV file format. Using the WMV video format essentially makes Silverlight useless for the vast majority of video websites such as YouTube. It cannot play .avi and .mov file. | Flash Video turned Flash into a mechanism for delivering media with far more potential than any other solution that is .flv, no doubt Flash has also limitation to play other video file. For that Flash required codex for that player installed on Client machine. |
Silverlight has no support for binding to models, binding to data, or even connecting to network resources to obtain data. | Even flash is also lacking this area. Flash can read data source in terms of XML or text from some URL and can use it. Same thing silverlight also can read. |
Silverlight doesn't even have support for things that should be considered a stock part of any library such as buttons, checkboxes, list boxes, list views, grids, etc. Probably in future release may Microsoft support it. | Flash has rich set of control library. |
Once the accessibility features are provided with Silverlight versions, any existing test tools that support driving UI through Accessibility will be fully enabled to automate Silverlight applications | Flash test tools are already in place. |
Silverlight 1.0 does not support GIF-file format. Even it doesn’t support BMP and other file format. It supports only JPG and PNG file format. | Support all image formats. |
Can’t do sound processing. | With some media file sound processing can possible. |
Socket programming is not possible. | Flash allows creating XML Socket object. |
Per pixel bitmap editing, bitmap filters (convolution, color matrix, etc), bitmap effects (drop shadow, blur, glow) cannot be done. | Can do that. |
Webcam and Microphone support it not there. | Flash supports it. |
Built in file upload/download support is not available. | Inbuilt Upload/download support is there. |
The performance of Silverlight and Flash will be nearly the same. While Silverlight is using XAML as description language in a non-compressed format size of Silverlight component is large.In practical implementation of similar component in Flash and Silverlight it has found that size of Silverlight component is approximately 10-20 times larger than Flash component. | Size of flash component is smaller. |
To deploy Silverlight to client browser more than one components ship. (1) XAML files (2) .dll if using C# (3) Silverlight.js (4) Custom JavaScript file. Images/videos/sounds also required deploy separately. | Flash ships in single component that is .swf. Images/video/sounds also incorporated in single .swf package. |
It has found in practical implementation of image animation, at some extent flickering occurs on image. | To avoid this type of flickering in flash, refresh layout or cache bitmap functionalities are available. |
It has found in practical implementation of video play, audio may start playing before showing movie on screen. It has also found video can still continue to play after redirecting to other page. It may be it is bug of current beta release. | Flash doesn’t face these types of issues. |
Right now not any support to play Silverlight object as Windows application. | Flash can be played as Windows application also by downloading player for it. Flash can be also packaged as .exe which can be deploying standalone. |
Silverlight is new in market and required time to get acceptance in market. | Flash is exist from many years and have strong acceptance in market. |
Silverlight Feature comparison with Flash Features: | |
Animation - Silverlight supports the WPF animation model, which is not only time based instead of frame based, but lets you define the start and end conditions and it will figure out how to get there for you. No need to deal with matrixes like in flash. Also no need to calculate positions on various frames. It just works. | The animation model is frame based. |
Silverlight uses XAML. XAML is text based and can be output using a simple XML object. | Flash stores its shapes using binary shape records. In order to write shape definitions, you will need to either license a 3rd party Flash file format SDK, or build your own. It isn’t too difficult, but it does require a bit of a learning curve. |
The debugging with Silverlight is simpler than with flash. | The debugging with flash is harder than Silverlight. |
Silverlight lets you embed true type font information directly into your projects, and download that information with the downloader object. | Dealing with fonts is fairly complex with flash. |
Rich set of development languages are available for Silverlight. Developer can use JavaScript as well as managed code VB.Net, C# for Silverlight development. | Only Action Script can be used as programming tool in Flash. |
XAML is declarative while ActionScript is imperative. Using imperative languages to build UIs goes back to the early days of DOS and Windows, when developers had to manage all of the API nuances when interacting with graphical panes. | ActionScript is an imperative language, which brings itself the pitfalls of imperative languages when compared with declarative languages. |
Web Services support for Silverlight Streaming:The services provided by Microsoft, called Silverlight Streaming, it allows users and developers to host their Silverlight content and apps with Microsoft, taking advantage of their extensive global network of datacenters and their content delivery network. Best of all, this service is free, and while currently it is only in alpha it allows users to upload up to 4GB of content, and to stream up to 1 million minutes of online video delivery at 700kbps, around DVD quality. Starting right now, you can build a total video content site using Silverlight at no cost. The future for this service looks good as they will incorporate Silverlight Streaming with the MSN Video ad network to allow you to easily monetize your video streams and participate in a revenue sharing opportunity with Microsoft while removing your distribution costs. There will also be a premium level of content delivery where you will be able to pay for higher levels of usage - the cost for this service is as yet unknown but expect it to be very low. | There is not any such service provided by Flash to host the content and application with them. Because of the absence of any such service, building a video site based on Flash is not as cost effective as building a video content site using Silverlight. Moreover, because of the Silverlight Streaming service, the existing Video Content sites might be moving to Silverlight site. |
Additional Support for mobile devices with desktop and desktop browsers:Silverlight is supported by Windows mobile device as part of a new service that the NBL have built. Silverlight applications and media streaming can be run on a mobile phone - so Silverlight even at this stage is about more than just the desktop browser and desktop market. Silverlight may be seen soon on the Symbian OS too. | Flash is not spread as across the vast majority of both desktops and mobiles platforms, as compared to Silverlight. Flash requires Flash Lite preinstalled on mobile devices. |
Silverlight does not require video codec to run industry standard videos like .WMV | Flash requires video codec to run .WMV videos. |
Silverlight supports scalable video formats from HD to mobile. | Flash does not support scalable video formats from HD to mobile |
Silverlight supports Hardware-assisted editing and encoding solutions. | Flash does not support Hardware-assisted editing and encoding solutions. |
Silverlight has XAML based presentation layer for SEO. | Flash does not have XAML based presentation layer for SEO. |
Silverlight provides End-to-end server and application platform. | Flash does not provide End-to-end server and application platform. |
Media server licensing is cheaper than flash. | Media server licensing is costlier than Silverlight. |
Silverlight supports Scalable full screen video. | Flash does not support Scalable full screen video. |
日期: 2009 年 5 月 12 日
Flash vs. Silverlight: What Suits Your Needs Best?
A best report about comparing Flash and Silverlight.Following:
http://www.smashingmagazine.com/2009/05/09/flash-vs-silverlight-what-suits-your-needs-best/
DataPager分页问题(点击两次)
今天碰到个怪问题,一直搞到半夜2点多。以下是解决办法:
今天看了一下ListView和DataPager配合做数据分页的教程,感觉很爽很方便,用在自己的项目上面时却出现了问题,具体表现在点击上一页、下一页或者数字跳转页面时通常要点两下才能有反应,而且有时候乱跳页。
我开始测试的代码是这样的:
public partial class ListViewTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
protected void BindData()
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
protected void BindData()
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}
出现如开始提及的问题,找了半天原因也没有找到。后来在国外的一个论坛上找到了同病相怜的人,有专家给出了一个解决方案。把Page_Load里的数据绑定移到Page_PreRender中,也就是:
public partial class ListViewTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
// BindData();
}
{
BindData();
}
protected void BindData()
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}
{
protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
// BindData();
}
protected void Page_PreRender(object sender, EventArgs e)
{
BindData();
}
protected void BindData()
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}
试了一下分页果然正常了。难道是Page_Load来的太迟?不得而知。另外,还有一种方法同样可行:
public partial class ListViewTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
{
//BindData();
}
{
DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
BindData();
}
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
protected void Page_PreRender(object sender, EventArgs e)
{
//BindData();
}
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
BindData();
}
protected void BindData()
{
DBDataContext db = new DBDataContext();
var ds = db.Category;
ListView1.DataSource = ds;
ListView1.DataBind();
db.Dispose();
}
}