I made some additions to the code you provided and did not reproduce your problem.
Xaml part :
<Grid>
<ProgressBar Name="prg" HorizontalAlignment="Left" Height="10" Margin="138,58,0,0" VerticalAlignment="Top" Width="100"/>
<Label Name="label1" Content="" HorizontalAlignment="Left" Margin="327,58,0,0" VerticalAlignment="Top" RenderTransformOrigin="5.441,-2.026"/>
<StackPanel Background="Azure" Height="100" Width="100">
<Image Name="coei" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Source="/paste.bmp"/>
</StackPanel>
<Label Name="lb2" Content="0" HorizontalAlignment="Left" Margin="502,59,0,0" VerticalAlignment="Top"/>
</Grid>
C# code:
//....Your code Window_Loaded
DateTime startTime = DateTime.Now;
string time;
double secs;
int seq=0;
private void dispatcherTimer_Tick(object sender, EventArgs e)
{
//....Your code
coei.Stretch = Stretch.Fill;
lb2.Content = seq;
}
}
public BitmapImage ImageSourceFromBitmap(string uri)
{
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri(uri, UriKind.RelativeOrAbsolute);
bi3.EndInit();
return bi3;
}
The result picture is:
Can you tell me which step I missed to reproduce your question?
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.