Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all, please suggest me.
I have db table in sql server image path: ~/Images/imag.png on physically store also have.
how can we retrive on that path Image



<ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition></RowDefinition>
                                        <RowDefinition></RowDefinition>
                                        
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition></ColumnDefinition>
                                        <ColumnDefinition></ColumnDefinition>
                                    </Grid.ColumnDefinitions>


                                <Image Grid.Row="0" Grid.Column="0" Source="{Binding Images}" />
                                <Button Grid.Row="0" Grid.Column="1" Text="{Binding Heading}"></Button>
                                

                            </Grid>
                                
                                
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>


What I have tried:

C# query

class Image
{
public string Heading { get; set; }
public string Images { get; set; }


}
Posted
Updated 13-Mar-22 3:55am
Comments
Maciej Los 13-Mar-22 9:52am    

1 solution

Please, read the documentation: Images in Xamarin.Forms - Xamarin | Microsoft Docs[^]

Quote:
Xamarin.Forms uses the Image view to display images on a page. It has several important properties:

Source - An ImageSource instance, either File, Uri or Resource, which sets the image to display.
Aspect - How to size the image within the bounds it is being displayed within (whether to stretch, crop or letterbox).

ImageSource instances can be obtained using static methods for each type of image source:

FromFile - Requires a filename or filepath that can be resolved on each platform.
FromUri - Requires a Uri object, eg. new Uri("http://server.com/image.jpg") .
FromResource - Requires a resource identifier to an image file embedded in the application or .NET Standard library project, with a Build Action:EmbeddedResource.
FromStream - Requires a stream that supplies image data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900