locked
display images & strings windows store apps

    Question

  • Dear team,

                    i am developing windows store application.it is a quiz application. i have to display sentences & images. As i am new to windows store application i don't know which control to use and how to use. 

    Eg:

    If the fractions are arranged in ascending order of their values, which one will be the third? (here the fractions are in image format)

    kindly help me.

     

    Saturday, September 27, 2014 7:22 PM

Answers

  • Try to set the a height and width for the image.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by mann madhan1 Monday, September 29, 2014 10:54 AM
    Monday, September 29, 2014 8:28 AM
    Moderator
  • i have fix this issue and write in my blog 

    http://mannmadhans.blogspot.in/2014/09/display-image-and-string-values-in.html

    • Marked as answer by mann madhan1 Monday, September 29, 2014 10:55 AM
    Monday, September 29, 2014 10:55 AM

All replies

  • Hi mann,

    RichTextBlock class might be a good choice, we can put both image and text inside:

    <RichTextBlock Grid.Column="0" IsTextSelectionEnabled="True" TextAlignment="Justify" 
                       OverflowContentTarget="{Binding ElementName=firstOverflowContainer}" 
                       TextIndent="12"
                       FontSize="12" FontFamily="Segoe UI" Foreground="#2a2a2a" Margin="20,0">
            <Paragraph>
                <Bold><Span Foreground="DarkSlateBlue" FontSize="16">Lorem ipsum dolor sit amet</Span></Bold>, consectetur adipiscing elit. Sed ac mi ipsum. Phasellus vel malesuada mauris. Donec pharetra, enim sit amet mattis tincidunt, felis nisi semper lectus, vel porta diam nisi in augue. Pellentesque lacus tortor, aliquam et faucibus id, rhoncus ut justo. Sed id lectus odio, eget pulvinar diam. Suspendisse eleifend ornare libero, in luctus purus aliquet non. Sed interdum, sem vitae rutrum rhoncus, felis ligula ultrices sem, in eleifend eros ante id neque. Vivamus quam lorem, varius vitae porta mollis, placerat quis est. Aenean eget sagittis massa. Sed tellus turpis, ullamcorper eget imperdiet vel, faucibus vel nisl. Nunc sed suscipit quam. Vivamus convallis faucibus dignissim. Fusce sollicitudin, quam vel cursus mattis, nisl velit tristique sapien, ac vestibulum ante arcu a nisl. Vestibulum commodo gravida ante at tincidunt. Vestibulum in ornare nunc. Nullam ut lorem vitae dui placerat lacinia sit amet a arcu. Nulla sit amet odio nisi. Praesent erat urna, venenatis ac adipiscing vel, congue at lectus. Proin ac metus at quam luctus ultricies.
            </Paragraph>
            <Paragraph>
                <Italic>This is an inline image.</Italic>
                <InlineUIContainer>
                    <Border Background="Black">
                        <Image Source="Assets/SmallLogo.png" Height="30" Width="30"/>
                    </Border>
                </InlineUIContainer> 
                Nam vitae ligula non ligula suscipit semper. Duis sed nulla metus, id hendrerit velit. Curabitur dolor purus, bibendum eu cursus lacinia, interdum vel augue. Aenean euismod eros et sapien vehicula dictum. Duis ullamcorper, turpis nec feugiat tincidunt, dui erat luctus risus, aliquam accumsan lacus est vel quam. Nunc lacus massa, varius eget accumsan id, congue sed orci. Duis dignissim hendrerit egestas. Proin ut turpis magna, sit amet porta erat. Nunc semper metus nec magna imperdiet nec vestibulum dui fringilla. Sed sed ante libero, nec porttitor mi. Ut luctus, neque vitae placerat egestas, urna leo auctor magna, sit amet ultricies ipsum felis quis sapien. Proin eleifend varius dui, at vestibulum nunc consectetur nec. Mauris nulla elit, ultrices a sodales non, aliquam ac est. Quisque sit amet risus nulla. Quisque vestibulum posuere velit, vitae vestibulum eros scelerisque sit amet. In in risus est, at laoreet dolor. Nullam aliquet pellentesque convallis. Ut vel tincidunt nulla. Mauris auctor tincidunt auctor.
            </Paragraph>
        </RichTextBlock>
    

    See XAML text display sample for more information.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Sunday, September 28, 2014 9:32 AM
    Moderator
  • Thanks jamles,

                   i am working on RichTextBlock only.

    i have already add a RichTextBox in my application in the Name of Madhan

    But it is not working properly 

    Image image = new Image();//img1.Source = new BitmapImage(new Uri("http://www.causingeffect.com/images/made/images/example/cow_square_200_200_int.jpg", UriKind.Absolute));
    
                image.Source = new BitmapImage(new Uri("http://www.causingeffect.com/images/made/images/example/cow_square_200_200_int.jpg"));
               
                this.InitializeComponent();
                Madhan.Blocks.Clear();
                //string value ="Hai this is new textbox";
                InlineUIContainer a = new InlineUIContainer();
                a.Child = image;
                var paragraph = new Paragraph();
                paragraph.Inlines.Add(a);
                Madhan.Blocks.Add(paragraph);

    But the image is not visiable

    kindly help

    Monday, September 29, 2014 8:21 AM
  • Try to set the a height and width for the image.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by mann madhan1 Monday, September 29, 2014 10:54 AM
    Monday, September 29, 2014 8:28 AM
    Moderator
  • Thanks a lot jamles it work well...
    Monday, September 29, 2014 8:32 AM
  • i have fix this issue and write in my blog 

    http://mannmadhans.blogspot.in/2014/09/display-image-and-string-values-in.html

    • Marked as answer by mann madhan1 Monday, September 29, 2014 10:55 AM
    Monday, September 29, 2014 10:55 AM