When one assignes Image.source using a Bitmap reference the
Image's properties (primarily the read only properties such as
contentWidth etc. to do with the height and width of an image) are
not reset (using the information in the Bitmap) as a result it is
virtually impossible to get the results required.
I'll try and explain the problem:
When you use:
Image1.source = "SomeUrlHere"
The internal properties of the image (particularly to do with
width and height aspects of the image) get reset to those from the
source just loaded.
However, if you use:
Image1.source = SomeBitmapReference
You don't get the same behaviour. This has an imapct if you
intend to use the same Image control over and over for many images.
An example of such a use would be a bunch of thumbnails in an image
gallery that when clciked on show up full size in the "main" image
control. Of course all images don't have the same height and width
and nor do they have the same width to height ratio. The main image
control in this case sizes to a smaller and smaller size and
eventually sizes down to zero. If you use the url to the image
(instead of a Bitmap reference) everything works as expected.
In my mind this is a bug. However if anyone has a work around
this or solution to this I'd appreciate it tremendously.