Questions tagged [imagesource]

332 questions
9
votes
4 answers

ImageSource from a relative resource

I'm trying to use a local resource to put an icon inside a Button. (C# Visual Studio 2012) Directly inside my project i have a folder called "Resources" which contains "Icons/MyIcon.png" The following code works (but is not using a relative…
00jt
  • 2,818
  • 3
  • 25
  • 29
8
votes
1 answer

Dispose StreamResourceInfo.Stream

I use StreamResourceInfo.Stream to get BitmapImages from resources. Is it correct to Close and Dispose the stream after using it? I ask because in memory profiler, I get an error if I do so. Memory profiler says that a disposed instance has not been…
HCL
  • 36,053
  • 27
  • 163
  • 213
7
votes
1 answer

Converting System.Drawing.Image to System.Windows.Media.ImageSource with no result

I would like to convert Image to ImageSource in my WPF app. I use Code128 library which works properly (already checked in WinForms app). Function below returns ImageSource with properly size, but nothing is visible. private ImageSource…
Julian Kowalczuk
  • 145
  • 1
  • 2
  • 10
6
votes
4 answers

how to show image not found in Asp.net MVC

I have a asp.net mvc project. in a speicific views i call the four image from different different folder inside my proect. sometime image can not be found. i want to set a image for every folder because all 4 folder contain different diffent size of…
user605334
6
votes
1 answer

How to convert a ViewBox to an ImageSource?

I'm using a Viewbox to create a set of icons that I will dynamically bind to a WPF view. I'm binding to the resource name and using a Converter to convert the resource name to an ImageSource. I know how to do it if the resource is a Path, but how to…
Rafael Romão
  • 1,788
  • 3
  • 20
  • 35
6
votes
1 answer

Setting an image.Source from a resource file

private void SetCredentials() { username = txtfromEmail.Text; password = txtpassword.Text; pictureLogin.Source = @"C:\Users\Sergio\Documents\Visual Studio 2008\Projects\emailwpf\emailwpf\ok.png"; } I get an error: "Cannot convert…
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
6
votes
0 answers

Get default jumbo system icon based on file extension

Solved! See EDIT 2 for working code. Based on the code from this site and the comments done by freundblase in the same site, I have the following class to get jumbo default icons based on file extension: // Original bad code removed I'm trying to…
user1537004
6
votes
2 answers

Displaying a GIF in Silverlight

I have a number of gifs in a folder on my web server /dir/subdir/bla.gif etc. On that same server is a Silverlight 3 application /ClientBin/bla.xap. Is there any way to display the gifs in the Silverlight app? I've tried and…
Saqib
  • 7,242
  • 7
  • 41
  • 55
6
votes
5 answers

How do I get link to an image on wikipedia from the infobox?

I'm parsing wikipedia infoboxes and I noticed that some infoboxes have image fields - these fields hold names of image files stashed on wikipedia somewhere. However they just contain the name of the file as is as opposed to the actual link. I…
Ali
  • 7,353
  • 20
  • 103
  • 161
6
votes
3 answers

Google Maps API version 3 causing images to be blurry / fuzzy

For some reason on Safari 5.1.5 Google Maps is blurring some of my images. Take http://catpr.com/craig-chapman/ for example - when it loads the chandelier renders crisply for a moment, and then blurs out. Removing
SparrwHawk
  • 13,581
  • 22
  • 61
  • 91
5
votes
1 answer

Programmatically set the background of a button to be an image

how can I programmatically set the background of a button to be an image? I know how to do it in XAML, but in code, I keep getting stuck, I tried Button.Background = new ImageBrush{ ImageSource = "source" }; but then I get the error that string…
GeekPeek
  • 1,615
  • 1
  • 20
  • 34
5
votes
4 answers

html Image source from UNC path

I need to set an image source to a location on the network. The image is located at machineName\mappedPath\abc.jpg. It does not load in any browser though all I need it to work in is IE v9 and above. When I inspect the location in the source it is…
user48408
  • 3,234
  • 11
  • 39
  • 59
5
votes
1 answer

Angular 2 get image src from authorized request

I'm using angular2-jwt to authorize the requests. I've got a get request which retrieves multiple documents from the API. A document can have multiple images which also need to be fetched using an authorized request. So obviously calling them…
Sephen
  • 1,111
  • 3
  • 16
  • 38
5
votes
4 answers

Xamarin.Forms Image.Source with SSL

I'm using an online store for user images uploaded with our App secured by SSL. The upload works all well as I'm using the WebClient with the certificate attached. But when I'm trying to use the Xamarin.Forms.Image component e.g. with the Source set…
Florian
  • 465
  • 5
  • 17
5
votes
1 answer

Xamarin Forms: How to use Embedded Resources in PCL Project for Image

I have 4 Images in my Resources Directory into my Portable Project and i would like to use them directly for an ImageSource (because i need to bind it). ImageSource myImageSource = ImageSource.FromResource("resources.image.png"); I tried this but…
Elykx
  • 217
  • 5
  • 15
1
2
3
22 23