Virtual Glass Images on the fly : Part 1

Posted by Darin Rousseau | Filed under ,

I am sure that you have personally witnessed the new trends in UI.  Everything seems to be 'glassy', reflective or whatever the term is these days. 

I think it was Apple that first mass-produced virtual glass on iTunes in their CoverFlow control - but it has been in other applications and now all over the web.  I recently had a requirement within one of my web projects that asked for glass - but it had a twist.  The client also wanted the site to be able to be themed.

Creating a shadow in an object in code is simple - you take the image, add some space to the bottom, flip the image and draw it upside down, add a gradient from partially opaque to the background color as you go down, and, you have a fancy, glassy, faded shadow!  

But what if you can't determine what the background is at runtime, for example like on a website?  This is the exact problem with themes and glass together.  The design of the site meant that anything could be a background - even another image.  I could never use a project like Kel whipped up on CodePlex - because I can't pass in a background Color parameter, since I don't know it.  I could have forced the theme to a consistent color, but that would be limiting, and potentially not what the client wants. 

Our next course of action was to see if Internet Explorer and the other browsers could handle Alpha-Blending in the PNG format, since PNG is one of the formats that supports alpha. (JPG and GIF don't, although GIF can have fully transparent sections.)  Luckily, most modern browsers could. 

The final challenge - how do you get an alpha-blended shadow in an image?

I went back to some Windows Mobile code that I had worked on that I had based on another article on-line (where, oh where did that article go?)  - where I copied the alpha from a GradientFill stencil. The basic process for the entire operation is as follows:

  • Take the original image and resize it to add space for the shadow.
  • Draw the original image at the top
  • Rotate the original image 180 degrees and flip it.
  • Draw the "shadowed" image under the original.
  • Create a new bitmap as a stencil
  • Draw a GradientRect with alpha blending
  • Lock the bits of the stencil
  • Copy the bitmap bits into an array
  • Lock the new image, put the new image bits into an array
  • Copy the alpha channel from the stencil to the new image.
  • Release the bits for the new image.

... Stay tuned for part 2 and source...

Software is changing

Posted by Darin Rousseau | Filed under

I had a chat with some former collegues the other week, and was reminiscing about the days of old.  We happened to discuss the days when Kernel versions were held and never changed.  In fact, any company playing with our very stable kernel version 1.3 would have some testing to do before we would adopt the new 1.4 version with something-or-other added to it.

Times have changed, or at least in my new client and working environment.  Now, needs decide the kernel and focus has left the "don't you dare change my kernel or-else" stance to one of "well, if it squeezes some power out of the processors, I will look at it."

In fact, I like what is happening.  I like the change.  I like taking hardware and running the OS of the day, then upgrading it and finding it runs about twice as fast.  To me, that is like putting updated software in my car and getting twice the speed, and twice the economy.  (I wish my car would do that.)  I like feeling like there is a something-for nothing equation in place, and perhaps only in software - it is possible and is happening more and more.  I think improvements should occur.  At the risk of signing my own death warrant, perhaps this model of software should be annually paid for in favour of speed and other updates - never having to purchase upgrades again.

Ok, wait - let me clarify.  I support that licensing model ONLY if I get something out of it.  If the OS or software using this model becomes stale and I am paying annually for absolutely nothing in return - forget it.  I do that now with other licensing.  Pay 1.5x the purchase price, and IF any upgrades come within a year, you get them free.  I don't think that has ever worked in my favour.

Service Outage Planned for April 6th&7th

Posted by Darin Rousseau | Filed under

Our Internet Service Provider will be doing some maintenance on our network connections on Monday April 6th during the night and Tuesday April 7th in the early Morning. 

Please be patient while we do our best to accommodate their changes and we will be back on-line Tuesday morning as soon as possible.

We don't expect any interruption other than those times unless we have contacted you beforehand.

What do we expect our software to do?

Posted by Darin Rousseau | Filed under

I had the opportunity to program some phone systems for a company, built on a hardened operating system with a *nix favour.  The exact one doesn't matter, but I found that it had a simple technical deficiency, related to daylight savings time.

The system appeared to have incorrect daylight savings time databases, and yet the system relied on time-of-day information to present call prompts to users.  For example, shuffling a call to a menu if the call occurred during the company hours versus another if the call occurred during non-hours.  Quickly I brought forward a support request with the owning company of the software, which the client had a support contract with.  "Just set the time zone to the one that matches, and set it back later." was the gist of the reply I received.

That bothered me.  It seems like a pretty obvious problem.  If your software relies on scheduling, it should coerce its behavior to that of anything time related in the world, for as long as it is relying on our region's time.  If the software doesn't have an automatic update process - then there should be some method of "hacking" the problem to set it and forget it.  (I heard that on an info-mercial once...)

In this particular customer's scenario, I could log in and set a custom timezone, which the support person should have announced to me, but it was I that happened to remember that option during the setup process when initially configuring the system.

These hardened phone systems or firewalls or other systems that have features such as time zone manipulation removed really have their work cut out for them when it comes to these regional changes.  In fact, a simple piece of software to calculate time differences suddenly becomes complex as we have to ask which timezone and more specifically where, and now even - which places are shifting timezones to accommodate energy savings initiatives.

We definitely will use these thought practices in our solutions when we can.