Questions tagged [imagesource]

332 questions
47
votes
5 answers

Change image source in code behind - Wpf

I need to set image source dynamically, please note my image is in somewhere on the Network, here is my code BitmapImage logo = new BitmapImage(); logo.BeginInit(); logo.UriSource = new Uri(@"pack://application:,,,\\myserver\\folder1\\Customer…
Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
42
votes
5 answers

BitmapImage to byte[]

I have a BitmapImage that I'm using in a WPF application, I later want to save it to a database as a byte array (I guess it's the best way), how can I perform this conversion? Or, alternatively, is there a better way to save a BitmapImage (or any of…
SoManyGoblins
  • 5,605
  • 8
  • 45
  • 65
35
votes
3 answers

How to correctly use the Image Source property with Xamarin.Forms?

I am having difficulty bringing up an image on the content page in a stack layout. I looked through Xamarin API Documentation and found Xamarin.Forms.Image.Source Property, but no sample code to see how it's written. I also checked to see how it was…
TheAmazingKnight
  • 2,442
  • 9
  • 49
  • 77
35
votes
6 answers

WPF - converting Bitmap to ImageSource

I need to convert a System.Drawing.Bitmap into System.Windows.Media.ImageSource class in order to bind it into a HeaderImage control of a WizardPage (Extended WPF toolkit). The bitmap is set as a resource of the assembly I write. It is being…
user3489135
  • 351
  • 1
  • 3
  • 5
31
votes
2 answers

Get Imagesource from Memorystream in c# wpf

How can I get ImageSource from MemoryStream in WPF using c# ? or convert MemoryStream to ImageSource to display it as image in wpf ?
kartal
  • 17,436
  • 34
  • 100
  • 145
31
votes
10 answers

WPF - Image 'is not part of the project or its Build Action is not set to Resource'

I have a project which requires an image in the window. This is a static image and i added through 'Add>Existing Item'. It exists in the root of the project. I reference the image in a test page like so -
EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105
31
votes
3 answers

@media queries and image swapping

I want the image in my site to completely change when the browser is resized. I've been using media-queries, but I can't seem to get it right. Any thoughts/tips?
Aarati Akkapeddi
  • 327
  • 1
  • 3
  • 7
30
votes
1 answer

Embedding resources (images, sound bits, etc) into a Java project then use those resources

I have searched for a method of embedding a resource in a java project (using Eclipse v3.6.0) then using that embedded resource within a control (e.g., JLabel). I have seen methods of referencing resources from the file system. Once the project…
lordhog
  • 3,427
  • 5
  • 32
  • 43
22
votes
4 answers

Display local image in UIImageView

How do I display an image in the UIImageView component from the hard drive? I have a local folder called "images" and would like to access it via a relative path, since I want to package the images with the app.
mirzahat
  • 1,025
  • 2
  • 10
  • 19
20
votes
5 answers

Python Scrapy: Convert relative paths to absolute paths

I have amended the code based on solutions offered below by the great folks here; I get the error shown below the code here. from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.utils.response import…
user818190
  • 579
  • 2
  • 11
  • 21
16
votes
3 answers

Loading image into ImageSource - incorrect width and height

My problem is that the image loading seems to be uncorrectly from application resources. This is code: BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new…
JSP
  • 457
  • 1
  • 7
  • 19
11
votes
5 answers

Create Video from ImageSource

Is there any easy way of adding ImageSources to a stack and create a video from it?
Anders
  • 17,306
  • 10
  • 76
  • 144
11
votes
2 answers

steal user's data by running html file

Let's talk about security. It seems to me, theoretically, I can get information from file system of a user with some script, if the user opens html file with it (opens from his file system, not from network). Look at the code: info.txt: my…
Danil Speransky
  • 29,891
  • 5
  • 68
  • 79
10
votes
2 answers

Get an image through jQuery AJAX

The following image tag is in my Login Page Captcha Now when I refresh my login Page, it works fine, and gets the image from the controller, but when I logOut and the login…
Paul Alwin
  • 181
  • 1
  • 2
  • 12
10
votes
1 answer

How do I change an image source dynamically from code-behind in WPF with an image in Properties.Resources?

I have a WPF application that needs to provide feedback to the user about an internal state. The design is to have three images, call them Red, Yellow, and Green. One of these images will be displayed at a time depending on the state. Here are…
dtaylor
  • 997
  • 3
  • 10
  • 26
1
2 3
22 23