I want to display an image in one of my view. I have set the path to the image as followed:
imSettings.ImageUrl = "~/Content/images/AquaHeader.png";
But in the browser I get a "ressource not found"-error. Which is because there is no images-folder inside the content folder when running the application. So why is this folder not available? What am I doing wrong?
Thanks in advance!
Related
I have an assets folder that I'm attempting to path to obtain my video game background
I've tried many variations of
Background = love.graphics.newImage(C:\Users\"pc name"\Desktop\SpaceshipGame\assets\"spacey.png")
Background = love.graphics.newImage(...\Spaceshipgame\assets\"spacey.png")
etc
C:\Users\"my pc name"\Desktop\SpaceshipGame\assets
what is the best way to path from SpaceshipGame->assets->spacey.png
if have any question ask away
The easiest and simplest path is simply:
Background = love.graphics.newImage("assets/spacey.png")
As long as the "assets" folder is in your project folder (The folder which contains your main.lua, etc) this will work.
Hope this helped!
First of all use / instead of \. Also you should have apostrophes around the directory as a whole and not separately around the image file name.
This code should work:
Background = love.graphics.newImage('assets/spacey.png')
Do we need to write the path of the asset from the asset folder or it saves somewhere else when it generate apk or ipa? Tried with using path from asset but didn't work.
String s="<img src="file:///asset/images/test.png" width="42" height="42" align="right">"
We are using this as a string and passing it in web view but web view is not showing the image.
<img src=\"file:///android_asset/flutter_assets/assets
the above code works for me in with this package -> flutter_inappbrowser
but i think it will work only for android.
You need to define your images in pubspec.yaml file as follows:
assets:
- assets/your_image.png
then you can use your images in code using their path.
I deleted an image file that stored under the IIS default path wwwroot\. Then I copied another image file to the same path with the same file name as the deleted one but IIS keeps rendering the deleted image. Why was that? And How to fix the problem?
For example:
I deleted Image A named 123.jpg and I copied Image B with the same file name 123.jpg to same folder, while I run the code <img src="~/images/mc/123.jpg" />, it keeps return Image A instead of Image B.
Why was that? And How to fix the problem?
I want to modify the script eval.lua provided in NeuralTalk2 code.
The script works with a given images' path.
I wish edit it in order to call this script giving just a single image path instead of the path of a directory containing several images.
Thanks in advance!
I'm developing a website based on drupal on my localhost. I have a problem with urls.
for a url like this :
http://localhost:81/my_website/library
I must output image src this way :
<img src="<?php print $directory; ?>/image/header/headerR.png"/>
but when the above url is changed to this
http://localhost:81/my_website/library/
I must output image src this way :
<img src="../<?php print $directory; ?>/image/header/headerR.png"/>
I mean it must refer to the parent. my website has contextual filter which can be inserted
after library/ .is there any general solution for handling such thing?
If you are printing an image directly to html you must use a non relative path to move to other dirs. You must always start the image path with /, so the image is relative to the domain, in this case, localhost. Example
<img src="/<?=$whatever; ?>" />
Also try building the image in the Drupal way. See these functions:
theme_image
theme_image_style
image_style_url
Use any of them, as you need.
Hope that helps.
use only relative path and put theme related images into your theme folder
lets say that your theme is named YOURTHEME
when you do <img src="/image/header/headerR.png"/>
it should load image from http://localhost:81/sites/all/themes/YOURTHEME/iamge/header/headerR.png
but if you need to load images from different than theme directory you will need to use CDN module https://drupal.org/project/CDN
you will be also able to load images easily from other server, its usefull when working on local DEV and getting images from production server