• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 41
  • Last Modified:

add images to list box at the runtime

Hi.
I have a problem that I couldn't resolve last few hours. Maybe you can help me/
My application generate a few images files, but only one of them will be showing in the big image control , all others have to be showing as a small images on the side of the big one. Not exactly on the side but separately. If user click on the of the  small images then this image take a place of the big one , the one was a big from the beginning will be showing as a small .
0
mastiSoft
Asked:
mastiSoft
  • 3
  • 2
1 Solution
 
Chinmay PatelEnterprise ArchitectCommented:
Hi mastiSoft,

 A couple of years back I developed a software for a certain organization in Europe. There requirement was huge but I will highlight some of the stuff they wanted me to do.

On a left panel, PDFs pages are displayed in a vertical scrolling pane and on right hand side we had a content control when user clicks on the left panel pdf page, it will be shown in the right hand side panel.

Are you trying to achieve something like this?


Regards,
Chinmay.
0
 
mastiSoftAuthor Commented:
I accepted your suggestion last time and develop my software in SDI not MDI as the previews version of this software. To be able open a few files in the SDI application I see the only one way . Open them all (the software create bitmap of the file) and show only one as the main image (big one with all scales and cursors) others like the pdf pages you told about will be on the left (or right) panel . So the idea is the same.
0
 
Chinmay PatelEnterprise ArchitectCommented:
Here is a rough solution, it can be improved 100 times. Let's go step by step.

WPF
<Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30"></RowDefinition>
                        <RowDefinition Height="30"></RowDefinition>
                        <RowDefinition Height="*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <ListView x:Name="ImageList" Grid.Column="0" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="AliceBlue" Margin="-30,0,0,0" SelectionChanged="ImageList_SelectionChanged">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <Image Source="{Binding}" Height="100" Width="250"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>

                    </ListView>
                    <Image x:Name="TargetImage" Grid.Column="1" Grid.Row="2" Source="Assets/SplashScreen.png"/>
                </Grid>

Open in new window



Code Behind
using System.Windows.Media.Imaging;

Open in new window


   private void ImageList_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            this.TargetImage.Source = new BitmapImage(new Uri(this.ImageList.SelectedItem.ToString(), UriKind.Relative));
        }

Open in new window


Result looks like this
Result looks like this
Regards,
Chinmay.
0
 
mastiSoftAuthor Commented:
thank you very much )
0
 
Chinmay PatelEnterprise ArchitectCommented:
Any time. 🙂
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now