I am just trying to add the image on index.html. I have create a folder of images under webcontent and add the image in images folder. I am calling it in the following way:
<HBox >
<Image
src="{./images/abc1.jpg}"
width="100%"
height="100%"/>
</HBox>
But it is showing nothing on browser. Please advice.
You use curly brackets when you are trying to bind data from a model.
Since you are not using a model to bind data. You can remove it and try.
Code for the same is as mentioned here:-
<HBox>
<Image src="./images/abc1.jpg" width="100%" height="100%"/>
</HBox>
Related
I have this file named loadingReviewButtonSpinner.gif, and this file is saved on my computer in the folder where I have my project images (assets/images), but I'm trying to reference to this file in my SVG, and it isn't working.
<svg
<image
width="70" height="70"
transform="translate(30.1 -7.5)"
href="loadingReviewButtonSpinner.gif"
/>
</svg>
I have also uploaded this same image (loadingReviewButtonSpinner.gif) to a server online, and when I do the reference to the online image, it working 100%
<svg
<image
width="70" height="70"
transform="translate(30.1 -7.5)"
href="https://tinypic.host/images/2022/05/18/animation_500_l1ki69jf.gif"
/>
</svg>
But I really need it to work for me referring to the folder where my project is.
And I already tried so many options, but none of them is working...
For example, I tried:
href="file://loadingReviewButtonSpinner.gif" (and the variations with the path)
href="//..//..loadingReviewButtonSpinner.gif"
href="file:///loadingReviewButtonSpinner.gif"
I did what was said in the comment and it worked.
I am new to UWP and try to learn a few basics, but i am currently struggling.
I have a button "To-Do" and want to Display a Image of a to-do-list above the button.
So i try this.. but that doesnt show me the Image. What did i wrong?
Thank you for your help!!!
<StackPanel Grid.Column="2" Margin="0,60,0,0">
<Grid>
<Image Source="/Bilder/todo.png" Width="100" Height="100" Grid.RowSpan="8" Grid.Row="1"/>
</Grid>
<Button x:Name="btnNaviZuToDo" Content="To-Do Liste" Height="86" Width="250" FontSize="40" Click="Button_NavigiereZuToDo" Margin="0,0,-2,0" HorizontalAlignment="Center" FontFamily="Calibri Light"/>
</StackPanel>
Please check your image path is correct.
Usually we will use ms-appx:/// as a prefix to define the root directory of the project. If the picture is in the Assets folder (which in the root of project), you can write: ms-appx:///Assets/todo.png, you can adjust your picture path accordingly.
Thanks.
you need to set todo.png's build action to Content.
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"/>
I am making a mobile app that will show users an image. Image is appearing witout a problem with this code:
<s:Image id="img" width="100%" source="assets/images/2.jpg"/>
But when I try to set the source property of Image like this:
function button1_clickHandler(event:MouseEvent):void
{
img.source = "assets/images/2.jpg";
}
<s:Image id="img" width="100%" />
the image is not appearing without error.
I don't know what I'm doing wrong, I just want to change image's source at runtime.
Problem solved after restarting Flash Builder
In my XUL I have the following code fragments:
<map name="KeypadMap">
<area href="javascript:pad('A')" coords="1,1,31,31" shape="rect"/>
</map>
...
<hbox flex="1">
<image src="./keypad.png" width="32" height="32" useMap="#KeypadMap"/>
</hbox>
The image displays just fine, however, when I mouse over, the cursor does not change to a hand, and clicking does not call the pad function.
Similar code works fine in straight HTML, so there must be some trick to get it working via a Firefox XUL file.
You'll have to use a namespace to embed HTML inside of XUL. Check this guide.