C# Add extra property/info to a Image

Related searches

I want to add a extra property or info to a image. I tried using a new class that gets the image propertys and i just add one, but i have no idea how to do this.

Also i cant use the property "Tag" thats already in use, and cant be overwritten

public partial class myImage : System.Windows.Controls.Image
{
        //? 
}

Adding a property to a class derived from Image would look like this:

public class MyImage : Image
{
    public string AdditionalInfoProperty { get; set; }
}

You could also create a Property that would hold an ImageSource object:

public class MyImage
{
    public ImageSource Image { get; set; }
    public string AdditionalInfoProperty { get; set; }
}

Then in your xaml you would use it like this, assuming that the DataContext holds an object of type MyImage.

<Image Source="{Binding Image}"/>
<TextBlock Text="{Binding AdditionalInfoProperty}"/>

Adding extra info to an image file, Adding additional info to an image using C#. when you click right click on the image in Windows and go to properties, in tab Details there are some more info� Examples. The following code example demonstrates constructing an ImageList, adding images to the Images property, setting the ImageSize property, and using the Draw method. To run this example, place it in a form that contains a button named Button1.


Gets or sets a value that represents the author of an image.

public System.Collections.ObjectModel.ReadOnlyCollection<string> Author { get; set; }

The following code example shows how to write metadata to a bitmap image by using friendly properties of the BitmapMetadata class.

FileStream stream3 = new FileStream( "image2.tif", FileMode.Create );
BitmapMetadata myBitmapMetadata = new BitmapMetadata( "tiff" );
TiffBitmapEncoder encoder3 = new TiffBitmapEncoder();
myBitmapMetadata.ApplicationName = "Microsoft Digital Image Suite 10";
myBitmapMetadata.Author = new ReadOnlyCollection<string>( 
    new List<string>() { "Mehdi Daustany" } );
myBitmapMetadata.CameraManufacturer = "Tailspin Toys";
myBitmapMetadata.CameraModel = "TT23";
myBitmapMetadata.Comment = "Nice Picture";
myBitmapMetadata.Copyright = "2010";
myBitmapMetadata.DateTaken = "5/23/2010";
myBitmapMetadata.Keywords = new ReadOnlyCollection<string>( 
    new List<string>() { "Mehdi", "Daustany" } );
myBitmapMetadata.Rating = 5;
myBitmapMetadata.Subject = "Mehdi";
myBitmapMetadata.Title = "Mehdi's photo";

// Create a new frame that is identical to the one 
// from the original image, except for the new metadata. 
encoder3.Frames.Add( 
    BitmapFrame.Create( 
    decoder2.Frames[0], 
    decoder2.Frames[0].Thumbnail, 
    myBitmapMetadata, 
    decoder2.Frames[0].ColorContexts ) );

encoder3.Save( stream3 );
stream3.Close();

Image.PropertyItems Property (System.Drawing), I want to add a extra property or info to a image. I tried using a new class that gets the image propertys and i just add one, but i have no idea how to do this. Adding additional info to an image using C# I was always wondering where are additional properties for the image stored. Simply, when you click right click on the image in Windows and go to properties, in tab Details there are some more info than just file size and image dimensions.


consider you have an image

Image img = Image.FromFile("C:\\temp\\smth\\smth.jpg");

use system drawing to get propertyitem

System.Drawing.Imaging.PropertyItem prop = img.PropertyItems[0];

set info

SetProperty(ref prop, 33432, "Test Info...");
img.SetPropertyItem(prop);

C# Add extra property/info to a Image - c# - csharp, Below is the list of possibilities to which you can confine your attribute. Image 5. Other than information what more can we do? One use which we� To begin, place an image file (such as a PNG) somewhere on your computer. Then, add the System.Drawing namespace to your C# project. If the namespace is not found, add the assembly reference System.Drawing. Next: Use the code here to open the Image (with Image.FromFile), and then access the Width, Height, or PhysicalDimension properties.


C# Attributes in 5 minutes, Some images – especially JPGs – can contain extended metadata. PropertyInfo item for the item , change its value and save the image again. Adding thumbnails can be a bit more involved as this chap found out , but the� The following code example demonstrates how to read and display the metadata in an image file using the System.Drawing.Imaging.PropertyItem class and the PropertyItems property. This example is designed to be used a Windows Form that imports the System.Drawing.Imaging namespace.


EXIF Tags in C#, Use the ImageUrl property to specify the URL of an image to display in the Image control. You can use a relative or an absolute URL. A relative URL relates the location of the image to the location of the Web page without specifying a complete path on the server. The path is relative to the location of the Web page.


Examples. The following code example demonstrates how to read and display the metadata in an image file using the PropertyItem class and the Image.PropertyItems property.. This example is designed to be used in a Windows Form that imports the System.Drawing.Imaging namespace.