Archive for the 'Microsoft' Category

(how not to) Build a Silverlight Media Player

Wednesday, January 30th, 2008

So I came across this small tutorial on the Reg entitled ‘Build a Silverlight media player’. Now I’m far from an expert on this stuff (hell I’m on Ubuntu, can’t even see the demo), but there were a few things in there that seemed odd, be interesting to hear feeback from someone that knows more…

* First of they say…

“Rather than work with Adobe’s Photoshop, let’s encourage the designer to use the new Microsoft Expression.”

… now I guess by that they mean ‘MS Expression Design’…. HAHAHA! (Please imagine a demented Tom Cruise type laugh there!) Every creative I’ve ever worked (i.e. many of the UK’s best) with would rather poke out their eyes with rusty nails than drop photoshop for some new untested tool, let alone one that comes from MS and doesn’t run on their Mac. I know (hope?) this isn’t the only way of getting your artwork in there, but surely you’ve failed at the first hurdle if you really expect this to happen. (Hmm, I wonder, can Design open PSD’s?)

* It’s not really covered in depth but they seem to do the actual layout design in Blend. Having been quite excited about Blend before it’s launch and in turn quite disappointed with it when I tried the first release, this seems to sum up the problem. Designers will not use Blend as a design tool, period, end of story. It’s an odd bastard child that sits somewhere between being too geeky for designers (loads of panels and event lists) and not geeky enough for developers (no code??)… it’s rather like the old days of clunky flash components and seems to me to be good for one thing, filling in and ticking little boxes to join the code and design up… an important task no doubt but who’s the tool intended for?

* Next there’s a little C# added in VS to hook the events up, all simple enough and easy to read from an AS perspective. I’m assuming here using ‘rootElement’ isn’t the cardinal sin ‘_root’ is in Flash? :)

* Then they use the timeline to animate the slideshow. Now I know this is a simple demo, but surely you’d want to show how to load images dynamically rather than embed them all, that’s just bad practice, no?

* On a side note, if I remember rightly the Blend timeline works more like coded Tweens in Flash, ie it’s all about the end points of the animation and not where the objects are starting from… this I like!

* They sum up with the statement…

“Traditionally graphic designers use a tool like Photoshop then “throw their design over the wall” to developers who are responsible for cutting the graphics into the application. The design very rarely works exactly as intended and considerable rework is required if the design changes. The combination of Expression and Visual Studio offers a way to close the gap between the two camps.”

..well I’d say designs and functionality will always change, and if you work in that way you’re always going to have problems. We (I?) work in a design led, technology based field and if your designers and developers don’t work hand in hand from the initial brainstorm through to delivery no amount of new tools are going to improve your end result. Surely better teamwork, understanding and communication would help close the gap?

So anyway, I’m not trying to bash the article, the authors or even Silverlight, I don’t know enough about it to do so, would instead welcome your thoughts and comments…

Embedding Flash in a .Net form

Sunday, January 28th, 2007

I’ve needed to do this various times and there’s always a few gotchas, here’s a brain dump for my own future reference if nothing else…

  • In Visual Studio 2005 Express Edition, go to Tools -> Choose Toolbox Items
  • From the “Com Components” panel tick “Shockwave Flash Object” then click OK.
  • In the toolbar now, if you expand the “All Windows Forms” group and look at the end you should see a new “Shockwave Flash Object” entry that you can drag onto your form.

swf_obj_img.JPG

To load a swf into your object, either set the full path in the “Movie” parameter using the Properties panel at design time, or at runtime using something like…

this.axShockwaveFlash1.LoadMovie(0, "D:\\test.swf");

Note - in both cases the paths must be absolute or the movie wont load.

If you get the error…

“Failed to import the ActiveX control. Please ensure it is properly registered”

…with VS running you need to go into the \obj\debug folder under your project root and delete any file(s) in there with ‘interop’ in their name. New (working) files should be auto generated for you and the problem fixed.

I’ll add more tid-bits to this list as I find them…

Will it blend…?

Sunday, December 17th, 2006

So, intrigued by some of the stuff I saw @ FOTB I’ve been playing a little with the latest beta of Microsoft’s Expression Blend and trying to get my head around what exactly it does and how.

There doesn’t seem to be much in the way of info or tutorials around at the moment (other than the few that come with it and a couple of handy ones @ ExpressionBlend.com), so I’ve been pretty much making it up as I go along. The result of my first little expriments is this simple analog clock app…

blend_clock.jpg

As I don’t really know if I’m doing this the right way, and to perhaps help others just starting, I’ve made a video walkthough of the creation of the clock and put the source code up for you to have a look at, if anyone knows a ‘better’ way of making this please comment (sorry about the bored cockney voiceover, it’s scary hearing myself speak! :) )

(Edit - just noticed the right click pop-ups don’t show up in the video, sorry about that, must be a Camtasia issue. I’ll try to fix it if I do another video)

UPDATE - 31/01/07 -
Due to popular demand (well, errr, Roger anyway :) ) the video is now available as a downloadable WMV also. Enjoy.

expressionblend.com for expression blend tutorials, xaml demo, wpf info