views:

1345

answers:

1

Behold the following XAML:

<Grid>
<HyperlinkButton x:Name="Link" Background="Green">
 <Grid Background="Red">
  <Grid.ColumnDefinitions>
   <ColumnDefinition Width="Auto" />
   <ColumnDefinition />
  </Grid.ColumnDefinitions>
  <Grid.RowDefinitions>
   <RowDefinition Height="Auto" />
   <RowDefinition Height="12" />
  </Grid.RowDefinitions>
  <Image x:Name="AvatarImage" Style="{StaticResource AvatarStyle}" Grid.Column="0" Grid.Row="0" />
  <StackPanel Grid.Column="1" HorizontalAlignment="Stretch">
   <TextBlock Text="New Topic" Style="{StaticResource ItemTypeStyle}" />
   <TextBlock x:Name="Title" Style="{StaticResource HeadlineStyle}" TextWrapping="Wrap" />
   <TextBlock x:Name="SubText" Style="{StaticResource TextStyle}" TextWrapping="Wrap" />
  </StackPanel>
  <TextBlock x:Name="TimeStampText" Grid.ColumnSpan="2" Grid.Row="1" Style="{StaticResource TimeStampStyle}" />
 </Grid>
</HyperlinkButton>

In the user control's Loaded event, I call the following code:

var imageUrl = new Uri("http://coasterbuzz.com/Forums/UserAvatar.ashx?id=2");
AvatarImage.Source = new BitmapImage(imageUrl);

Looking at Firebug, the image is coming down the wire, but for some reason it's not displayed. Any guesses as to why? You'd probably like to see the styles, but note that if I remove the styles, nothing changes.

+1  A: 

Ah, easy answer. Silverlight 2 doesn't support GIF.

There is a handful of solutions to convert the image serverside here: http://silverlight.net/forums/t/3883.aspx

The most official reason I can find:

Why the support for displaying a .gif image is is missing? When it will be added?

We don’t want to take the hit for another codec. It may only be a little bit of download time—but our mandate is small and fast and every little bit counts. We are also hesitant to support .gif because it implies support for animated .gif, which we decided would have to be integrated into our animation scheme somehow—and that will be a lot of work.

Looking from Flash perspective, Flash does not support .gif either. However, as of present, this is something being evaluated, but no date has been announced

http://blogs.msdn.com/ashish/archive/2008/04/03/silverlight-roadmap-questions.aspx

russau
This is Silverlight 3. The weirdness here is that it was displaying at one point.
Jeff Putz
Nevermind, was a strange quirk of a graphic that was not the type I thought it was.
Jeff Putz