Solved

Phone 8 Emulator Not Showing Images

Posted on 2014-01-18
3
830 Views
Last Modified: 2014-11-12
I am building a phone 8 app which uses the Tap event when a button is tapped.

Debug testing with a stop point shows that the event is triggered.

    void cmdHole1_Tap(object sender,
                     System.Windows.Input.GestureEventArgs e)
        // Place image into imgHole1
        {
            imgHole1.Source = imgC1Clip.Source;  // This works
            int intTest1 = 1;

        }

The issue is that the emulator does not display the button image.

The button image is displayed in design mode.

I am using the default emulator: WVGA 512MB and running Windows 8 Pro.

See file images:

How do I fix this?

Thanks,
DesignMode.jpg
DebugMode.jpg
0
Comment
Question by:Dovberman
  • 3
3 Comments
 

Author Comment

by:Dovberman
ID: 39790706
Here is the xaml code for the hole cards:

        <Grid x:Name="grdHole" Margin="183,400,183,286" Background="DarkOliveGreen"
              Height="72" Width="114" HorizontalAlignment="Center"  >
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="grdHole1"
                    Width="52">
                </ColumnDefinition >
                <ColumnDefinition
                    Width="52">
                </ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition
                    Height="72">
                </RowDefinition>

            </Grid.RowDefinitions>

            <!--Place buttons in the grid-->
            <Button Content="Button"  x:Name="cmdHole1" Grid.Column="0" Width="50" Height="72"
                    HorizontalAlignment="Center" Margin="4,0,0,0" Grid.RowSpan="1" Cursor="Hand"
                    >

            </Button>
            <Image x:Name="imgHole1"
                Width ="48"
                Source="C:\Develop\Apps\Holdem\Images\cards_png\C1Full.png"
                Height="70"
                Grid.Row="0"
                Grid.Column="0" Stretch="None"
            />
            <Button Content="Button" x:Name="cmdHole2" Grid.Row="0" Grid.Column="1" Width="50" Height="72"
                    HorizontalAlignment="Center" Margin="4,0,0,0" Grid.RowSpan="1">
            </Button>
            <!--Place images in the grid-->
            <Image x:Name="imgHole2"
                     Width ="48" Source="C:\Develop\Apps\Holdem\Images\cards_png\C2Full.png"
                     Height="70"
                     Grid.Row="0"
                     Grid.Column="1" Stretch="None"
                />

        </Grid>

  <TextBox x:Name="PickHoleInstr" HorizontalAlignment="Left" Height="60" TextWrapping="NoWrap"
                Text="Tap to select your hole cards."
                Margin="72,250,0,0" VerticalAlignment="Top" Width="261"
                FontSize="16" Background="Transparent" BorderThickness="0"
                Foreground="White" FontWeight="Bold"/>
0
 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 39796887
The issue was in the image source.

 <Image x:Name="imgHole1"
                Width ="48"
                Source="C:\Develop\Apps\Holdem\Images\cards_png\C1Full.png"
                Height="70"
                Grid.Row="0"
                Grid.Column="0" Stretch="None"
            />

The phone knows nothing about the developer's hard drive.
Images need to be imported to a Project folder.

In this case I created a project folder named Images and imported all the images from my
hare drive folder to the Project->Images folder.
0
 

Author Closing Comment

by:Dovberman
ID: 39796895
Hope this is useful to other phone app developers.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

With Windows evolving further, the built-in protective mechanisms get better and better. Still, Microsoft is not very good at introducing those to the technical community. This article is about a new bitlocker functionality that could revolutionize …
Detailed instructions on how to install an Access add-in in recent versions of Office and Windows (with screen shots)
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now