I have a bitmap object that is not a static resource. Normally, with image binding in WPF you can bind to a string path. However, I have a dynamically created bitmap object that I would like to bind to. Is it possible to do something like:  &lt;WrapPanel x:Name="imageWrapPanel" HorizontalAlignment="Center"&gt;     &lt;Image Source="{Binding Material1}" Margin="10" /&gt;     &lt;Image Source="/NightVision;component/Images/concrete_texture.tif" Margin="10" /&gt; &lt;/WrapPanel&gt;   And in the code behind file I have a public accessor:  public Bitmap Material1 {      get      {           return new Bitmap(/* assume created somewhere else*/)      }  }   The above is obviously not working however, is there a way to do something similar?
122124
I'm trying to bind a list of custom objects to a WPF Image like this:  &lt;Image&gt;     &lt;Image.Source&gt;         &lt;BitmapImage UriSource="{Binding Path=ImagePath}" /&gt;     &lt;/Image.Source&gt; &lt;/Image&gt;   But it doesn't work. This is the error I'm getting:  "Property 'UriSource' or property 'StreamSource' must be set."  What am I missing?
40837
There is another question on here that allows users to find the path to their current background image through a cmd command.    In Windows 10 this no longer works. It only returns the first image in the folder, it does not change with the backgrounds as they transition. I need a similar command that returns the path(s) to the current image on the desktop background(s) that actually works in Windows 10 if one exists.
14005
I have an instance of a System.Drawing.Bitmap and would like to make it available to my WPF app in the form of a System.Windows.Media.Imaging.BitmapImage.  What would be the best approach for this?
74903
I'm trying to write a light-weight image viewing application. However, there are system memory limitations with .NET.  When trying to load large bitmaps (9000 x 9000 px or larger, 24-bit), I get a System.OutOfMemoryException. This is on a Windows 2000 PC with 2GB of RAM (of which 1.3GB is used up). It also takes a lot of time to attempt loading the files.  The following code generates this error:  Image image = new Bitmap(filename); using (Graphics gfx = this.CreateGraphics()) {     gfx.DrawImage(image, new Point(0, 0)); }   As does this code:  Stream stream = (Stream)File.OpenRead(filename); Image image = Image.FromStream(stream, false, false); using (Graphics gfx = this.CreateGraphics()) {     gfx.DrawImage(image, new Rectangle(0, 0, 100, 100), 4000, 4000, 100, 100, GraphicsUnit.Pixel); }   Also, it is enough to do just this:  Bitmap bitmap = new Bitmap(filename); IntPtr handle = bitmap.GetHbitmap();   The latter code was intended for use with GDI. While researching this, I found out that this is in fact a memory issue where .NET tries to allocate twice as much as is needed in a single contigous block of memory.    I know from other applications (Internet Explorer, MS Paint etc.) that it IS possible to open large images, and rather quickly. My question is, how do I use large bitmaps with .NET?  Is there anyway to stream them, or non-memory load them?
118399
I'm going to have to build a custom control for a WinForms application. But in the near future that same control will have to be used in a WPF application.  I've already written all the logic in a controller class which I can use for both WinForms and WPF (I will only have some databinding to do and that's it), but of course it would be easier to develop and maintain the control only once.  So can I build the control in WPF and then put them on a WinForms form? My projects currently have 3.0 as their target framework.
17511
So this seems pretty basic but I can't get it to work.  I have an Object, and I am using reflection to get to it's public properties.  One of these properties is static and I'm having no luck getting to it.  Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo     Return obj.GetType.GetProperty(propName)  End Function   The above code works fine for Public Instance properties, which up until now is all that I have needed.  Supposedly I can use BindingFlags to request other types of properties (private, static), but I can't seem to find the right combination.  Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo     Return obj.GetType.GetProperty(propName, Reflection.BindingFlags.Static Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Public)  End Function   But still, requesting any Static members return nothing.  .NET reflector can see the static properties just fine, so clearly I am missing something here.
114745
I am trying to Preview and download document from LWC, From apex controller i am returning Map&lt;> contains ID and Document name, and iteration that map data in html file and passing map.key value to href url, but dynamic is not populating in URL.    &lt;template for:each={mapData} for:item="mapkey"&gt;                            Test: {mapkey.key}                                                         &lt;lightning-button-icon key={mapkey} icon-name="utility:download"  variant="bare" alternative-text="Settings"&gt;&lt;/lightning-button-icon&gt;                                &lt;a key={mapkey} style="color: #000000"  href ="/sfc/servlet.shepherd/document/download/{mapkey.Key}?operationContext=S1" target="_blank" preview= "{mapkey.value}"&gt;{mapkey.value}&lt;/a&gt;                          &lt;/template&gt;    JS Code:      .then(data =&gt; {            /// var conts = data;                   console.log('data map---&gt;'+data);     if(data){     // eslint-disable-next-line guard-for-in     for(let key in data) {    this.mapData.push({value: data[key], key:key}); //Here we are creating the array to show on UI.    }       } })   Apex Code:   @auraenabled /* Method will return a Map Contains Document ID and Name */ public static Map&lt;string,string&gt; getUrls( string searchstr){     Map&lt;string,string&gt; contdocidandtitle = new Map&lt;string,string&gt;();     system.debug('searchstr'+searchstr);             For(Document cd :[select id,folderid,name from document where folder.name =:searchstr]){         contdocidandtitle.put(cd.id,cd.name);                 }     return contdocidandtitle; }   Error is: sfc/servlet.shepherd/document/download/%7Bmapkey.Key%7D?operationContext=S1 in URL "mapkey.key" priniting instead of ID Help me with valuable suggestions.
119048
I'm trying to draw images on a C# form (in PictureBoxes, as well as using Graphics.DrawImage()), and am looking for a way to draw them smooth.  The images must be a format that supports transparency, so PNG, GIF, SVG, and WMF.  C# doesn't support SVG files out of the box, and I haven't found a good third-party library to use (I found SvgNet, but couldn't figure it out).  I need to draw a WMF file, which C# can do via the Image.FromFile() function, but it's not anti-aliased.  I was wondering if there's any way to smooth this out?
34739
Say I have an interface like this:  public interface ISomeInterface { ... }   I also have a couple of classes implementing this interface;  public class SomeClass : ISomeInterface { ... }   Now I have a WPF ListBox listing items of ISomeInterface, using a custom DataTemplate.  The databinding engine will apparently not (that I have been able to figure out) allow me to bind to interface properties - it sees that the object is a SomeClass object, and data only shows up if SomeClass should happen to have the bound property available as a non-interface property.   How can I tell the DataTemplate to act as if every object is an ISomeInterface, and not a SomeClass etc.?  Thanks!
71445
I want to put a 2D image on a 3D object in Blender. How do I do that?  I have found the "textures" tab in the "properties" window, but I can't figure out what to do with it.  Preferably, I would like to click and drag an image off my desktop right onto the object.
78687
To do DataBinding of the Document in a WPF RichtextBox, I saw 2 solutions so far, which are to derive from the RichtextBox and add a DependencyProperty, and also the solution with a "proxy".  Neither the first or the second are satisfactory. Does somebody know another solution, or instead, a commercial RTF control which is capable of DataBinding? The normal TextBox is not an alternative, since we need text formatting.  Any idea?
3658
I have a non-visual component which manages other visual controls.    I need to have a reference to the form that the component is operating on, but i don't know how to get it.  I am unsure of adding a constructor with the parent specified as control, as i want the component to work by just being dropped into the designer.  The other thought i had was to have a Property of parent as a control, with the default value as 'Me'  any suggestions would be great  Edit:  To clarify, this is a component, not a control, see here :
44149
I'm experimenting with the  feature, and embedding it in a Visualforce page, from where I hoped I would have some control over the canvas.  Now, the apex:canvasApp has a property called  and it's description says that they're parameters passed to the canvas app.    When I don't use the parameters attribute the canvas page draws normally, and using firebug I can see the call to the ip address of the canvas app. But for it to be useful to me I need to pass some parameters to the canvas page and when I do use the parameters attribute the canvas simply does not show, and in firebug it does not show any call to the ip of the canvas.  How are these parameters passed or how can one catch them? Using firebug, in the call to the ip of the canvas app, I can't see any of the parameters that I'm trying to pass.  Here's the simple code I'm experimenting with:  &lt;apex:page &gt; &lt;apex:canvasApp applicationName="Test Canvas" height="400px" width="750px" parameters="{vst_cli: '1293'}" /&gt; &lt;/apex:page&gt;   Inside the parameters attribute I've tried some different things: "{vst_cli: '1293'}" "{vst_cli: 1293}" "{'vst_cli': '1293'}" All of which had the same effect.  Any help or pointers will be welcome.  Thanks in advance.
69028
I'm tryning to apply a Texture Image to an object, but it don't work. I unwrapped the object and created the image in the UV/Image Editor. If i try to assign any other simple materials with just color, it won't work either. In the material preview it's showing nicely. As you can see   Thanks!
112802
i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reason i do this is because i'm dynamically creating images and as such .. i need to use a memory stream.  this is the code:  [TestMethod] public void TestMethod1() {     // Grab the binary data.     byte[] data = File.ReadAllBytes("Chick.jpg");      // Read in the data but do not close, before using the stream.     Stream originalBinaryDataStream = new MemoryStream(data);     Bitmap image = new Bitmap(originalBinaryDataStream);     image.Save(@"c:\test.jpg");     originalBinaryDataStream.Dispose();      // Now lets use a nice dispose, etc...     Bitmap2 image2;     using (Stream originalBinaryDataStream2 = new MemoryStream(data))     {         image2 = new Bitmap(originalBinaryDataStream2);     }      image2.Save(@"C:\temp\pewpew.jpg"); // This throws the GDI+ exception. }   Does anyone have any suggestions to how i could save an image with the stream closed? I cannot rely on the developers to remember to close the stream after the image is saved. In fact, the developer would have NO IDEA that the image was generated using a memory stream (because it happens in some other code, elsewhere).  I'm really confused :(
103070
I know how to do it in WinForms  byte[] binaryData = Convert.FromBase64String(bgImage64); image = Image.FromStream(new MemoryStream(binaryData));   but how do i do the same thing in WPF?
96073
I'm trying to load an image from jpeg file and to add the material to the cube using the following code: bpy.ops.image.open(filepath=&quot;/root/carteid_dini.png&quot;, directory=&quot;/root/&quot;, files=[{&quot;name&quot;:&quot;carteid_dini.png&quot;, &quot;name&quot;:&quot;carteid_dini.png&quot;}], relative_path=True, show_multiview=False)  # get material reference mat = bpy.context.view_layer.objects.active.active_material  # get texture reference tex = bpy.data.images.get('carteid')  # create node and assing the texture to it image_node = mat.node_tree.nodes.new('ShaderNodeTexImage') image_node.image = tex  mat.node_tree.links.new(image_node.outputs['Color'], mat.node_tree.nodes['Principled BSDF'].inputs['Base Color'], verify_limits=True)  cube = bpy.context.active_object   if len(cube.material_slots) == 0:     bpy.ops.object.material_slot_add()  cube.material_slots[0].material= mat  When I run this code, the newly created texture is unfortunately not loaded and the image is not selected for the 'Base Color'. Q: How to load an image from the disc and and assign it to an arbitrary image texture node?