Jump to content
  • Advertisement
Sign in to follow this  
Winegums

[.net] Problem finding images in Blend/VS

This topic is 4013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've taken some code from a book and, while the code runs fine from it's own file if put in XAMLPad, if i try running it in blend or VS it won't display the images used on the buttons. This is especially confusing as they appear in the Design view of the application. Is there a setup proces I have forgotten to do? here's the source Window1.xaml
<Window  x:Class="WindowsApplication4.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Simple Window">
  <Window.Resources>
    <LinearGradientBrush x:Key="backgroundBrush" StartPoint="0,0" EndPoint="1,1">
      <GradientStop Color="Blue" Offset="0"/>
      <GradientStop Color="White" Offset="0.5"/>
      <GradientStop Color="Red" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="borderBrush">Red</SolidColorBrush>
  </Window.Resources>
  <Window.Background>
    <StaticResource ResourceKey="backgroundBrush"/>
  </Window.Background>
  <DockPanel>
    <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal"
      HorizontalAlignment="Center">
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="zoom.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="defaultThumbnailSize.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="previous.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="slideshow.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="next.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="counterclockwise.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="clockwise.gif"/>
      </Button>
      <Button Background="{StaticResource backgroundBrush}"
        BorderBrush="{StaticResource borderBrush}" Margin="5">
        <Image Height="21" Source="delete.gif"/>
      </Button>
    </StackPanel>
    <ListBox/>
  </DockPanel>
</Window>




Window1.xaml.cs

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;


namespace WindowsApplication4
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>

    public partial class Window1 : System.Windows.Window
    {

        public Window1()
        {
            InitializeComponent();
        }

    }
}




Edit: Tried adding the files as a resource in Visual Studio, but that seems to have made no difference other than now showing them as dead links in the 'project' view of Blend! [Edited by - Winegums on June 1, 2007 3:56:13 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!