Image files not displaying - windows-phone-7

In my XAML code I have written this:
<Image Source="/Images/male32.png" Visibility="Visible" />
and my project file structure looks like so:
But my image is just not loading?? As you can see I'm trying to add the male32.png image that I have in the Images folder in my project..

Check the build action of the Image.
Example:
When you use "Build Action" of type "Content" then you access your image in this way:
<Image Stretch="None" Source="/images/appbar.cancel.rest.png"/>
When you use "Build Action" of type "Resource" then you access your image in this way:
<Image Source="/WP7SampleProject3;component/images/appbar.feature.email.rest.png"/>

Okay I figured it out, turns out it didn't have anything to do with the BuildAction property, all I had to do in the image path was add ".." e.g. "../Images/male32.png".
Stupid issue that's not even supposed to be an issue.
Nonetheless I have read that BuildAction could also be a potential reason ones image is not displaying. So worth checking out if you have problems with images not displaying.

Related

NEXTJS - public images not showing on dynamic routes

I have a problem with serving a static image from my public/images folder.
It correctly displays in the files I've been working on so far EXCEPT the dynamic file [itemId].js (shown in the picture below)
The most interesting clue I have is this error in the console.
http://localhost:3000/items/_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=1920 404 (Not Found)
It tries to serve from /items, which is not what I want at all...
Does anyone know what's the trick behind this? If you need more informations, let me know.
// in components/Header.js (which is wrapping all of my pages)
import bannerBig from "../public/images/banner-big.png";
// then i use it this way with the Image component from next/image
<Image src={bannerBig} alt="midnight city" width={1920} height={800}/>
The img generated by the <Image /> component looks like this and is the same accross all of my pages:
<img alt="midnight city" src="_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=3840" decoding="async" style="position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%" srcset="_next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=1920 1x, _next/static/image/public/images/banner-big.f496e182c5dd297c1d1c030d9b7436d8.png?auto=format&fit=max&w=3840 2x">
so I finally fixed the problem by adding a '/' before my static image path so it's always being served from the root
<Image
src={"/" + bannerBig.src}
alt="midnight city"
width={bannerBig.width}
height={bannerBig.height}
/>

Getting out of memory exception while loading image using 'FFImageLoading.CachedImage' in xamrinform

I want to show list of images in single page as like gallery. In my xaml page I am creating single wrap view, in that wrap view I have
add ffimageloader for loading images. Here I have gave list of image url' to that wrap view contain ffimageloader. When I called that page it shows fallowing error.
system.outofmemoryexception: out of memory at ffimageloading.platformimageloadertask..... like that. many post's suggest if we using ffimageloader instead of image tag we will reduce this type of issues but still getting same issues after using this one also. I am running my application in xamarin android. Please suggest any idea.
Here is the sample code what I have tried
<CustomWrapView x:Name="SampleGalleryView" ItemsSource="{Binding GalleryImages}">
<CustomWrapView.ItemTemplate>
<DataTemplate>
<ffimageloading:CachedImage Source="{Binding ImageUrl}" />
</DataTemplate>
</CustomWrapView.ItemTemplate>
</CustomWrapView>
Take a look at FFImageLoading's downsampling capabilities. You can read more about it here: https://github.com/luberda-molinet/FFImageLoading/wiki/Xamarin.Forms-API#downsampling-properties
If you have a lot of items, you should use some view which is capable of doing items virtualisation (I suspect that WrapView isn't), like: ListView / CarouselView, etc

RadToolbar doesn't show Images

I have an RadToolbar control on my Page. The problem is the Images I have placed on my buttons don't show. My code seems fine. Whats the issue?
<telerik:RadToolBar Grid.Row="1"
Margin="20,20,5,10">
<Button Width="25"
Click="OnInsertClick">
<Image Source="Images/add.png"/>
</Button>
<Button Width="25">
<Image Source="Images/delete.png"/>
</Button>
</telerik:RadToolBar>
I also tried addressing like /Images/add.png but to no avail
It depends on where your page is located in the project. If it's on the same level as Images folder, your code should work. But if it's in separate folder, you'll need to use dots to go up a level:
<Image Source="../Images/add.png"/>
If your page is located deeper in folder structure, you'll need to add dots for every level.
Alternatively, you can use full notation to avoid playing with dots (change the name for your assembly name from project properties):
<Image Source="/AssemblyName;component/Images/add.png"/>

Restore Layout does not restore the modules content

i"m using prism with AvalonDoc.
when i try to restore the layout (on the event handler of the menu button "RestoreLayout")
dockManager.RestoreLayout(FileName);
i do get the correct layout structure, but the content of every region is now empty. do i need to reload to modules or something like that ?
the avalondoc code im my xaml code is something like that:
<ad:ResizingPanel ad:ResizingPanel.ResizeWidth="*" Orientation="Vertical" VerticalAlignment="Top">
<ad:DockablePane ad:ResizingPanel.ResizeHeight="150" prism:RegionManager.RegionName="RegionDocPane1">
<ad:DockableContent Name="DocContent1" HorizontalAlignment="Left"/>
</ad:DockablePane>
</ad:ResizingPanel>
<ad:DockableContent Name="DocContent2" HorizontalAlignment="Right"/>
</ad:ResizingPanel>
</ad:DockingManager>
It won't restore your content because Avalon dock (and most docking mechanisms) don't and can't store your user-controls state. You need to do this manually.

Generating and displaying images in grid in Silverlight

I want to develop an webpage like Google Images in Silverlight.
The difference is the images are generated from my DSL.
The webpage shows different images in grid and allows users to pick one.
The webpage then shows similar images to this.
Should I use Grid panel or DataGrid? And how do I handle double click on cells?
Should I generate my DSL to Shapes or Image? What are the pros and cons?
Thanks.
This is actually pretty simple, all you need to do is use a data template for the column in your datagrid.
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Width="80">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Width="240" Height="180" Source="http://www.yourimage.com/images/myimage.png" />
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
Optional: If you need to change the image via code rather than inline like this then in place of the Image XAML element put a stackpanel that calls a function in your code-behind, which returns an image.
<StackPanel Loaded="StackPanel_Loaded"></StackPanel>

Resources