You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Metadata > TagSetValueString Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TagSetValueString Method

Writes a tag from data stored within formatted string.

C#
public GdPictureStatus TagSetValueString(
    int ImageID, 
    Tags TagID, 
    TagType TagType, 
    String TagData
);
Visual Basic
Public Function TagSetValueString(
    ByVal ImageID As Integer, 
    ByVal TagID As Tags, 
    ByVal TagType As TagType, 
    ByVal TagData As String
) As GdPictureStatus
Parameters
Parameters 
Description 
ImageID 
GdPicture Image Identifier.  
TagID 
A member of the Tags enumeration.  
TagType 
Type of the tag to write. A member of the TagType enumeration.
You can check the exif specifications to use the good type of tag.
The EXIF specifications can be found at: http://www.exif.org  
TagData 
The formatted tag value.
Notes for BYTE tags:
BYTE tags will have this mask: "#,#,...,#".
[#] : A component as unsigned 8-bit integer with a value between 0 and 255.
[,] : A component delimiter.


Notes for SHORT tags:
SHORT tags will have this mask: "#,#,...,#".
[#] : A component as unsigned 16-bit integer with a value between 0 and 65535.
[,] : A component delimiter.


Notes for Integer tags:
Integer tags will have this mask: "#,#,...,#".
[#] : A component as unsigned 32-bit integer with a value between 0 and 4294967295.
[,] : A component delimiter.


Notes for SInteger tags:
SInteger tags will have this mask: "#,#,...,#".
[#] : A component as signed 32-bit integer with a value between -2147483648 and 2147483647.
[,] : A component delimiter.


Notes for RATIONAL tags:
RATIONAL tags will have this mask: "#/#,#/#,...,#/#".
[#/#] : A component will consist of two unsigned 32-bit integers denoting the enumerator and denominator. Each integer will have a value between 0 and 4294967295.
[,] : A component delimiter.


Notes for SRATIONAL tags:
RATIONAL tags will have this mask: "#/#,#/#,...,#/#".
[#/#] : A component will consist of two signed 32-bit integers denoting the enumerator and denominator. Each integer will have a value between -2147483648 and 2147483647.
[,] : A component delimiter.  
Returns

A member of the GdPictureStatus enumeration.

Available for EXIF TAGs, Image property ID Tags, Extra TAGs (Like Adobe Image Information tags etc.), Thumbnail related TAGs and Gps TAGs

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim oGdPictureImaging As New GdPictureImaging
    Dim ImageID As Integer
 
 
    oGdPictureImaging.SetLicenseNumber("XXX")  'Please, replace XXXX by a valid demo or commercial license key.
    'Go to http://evaluation-gdpicture.com to get a 1 month trial key unlocking all features of the toolkit.
 
    ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("")
 
    'Write SoftwareUsed tag
    oGdPictureImaging.TagSetValueString(ImageID, Tags.TagSoftwareUsed, TagType.TagTypeASCII, "mysoftware Vers. 1.2")
    'Write Artist tag
    oGdPictureImaging.TagSetValueString(ImageID, Tags.TagArtist, TagType.TagTypeASCII, "MyCompany GmbH")
 
    'Writes X & Y resolution Tags (300 DPI)
    oGdPictureImaging.TagSetValueString(ImageID, Tags.tagXResolution, TagType.TagTypeRational, "300/1")
    oGdPictureImaging.TagSetValueString(ImageID, Tags.tagYResolution, TagType.TagTypeRational, "300/1")
 
 
    oGdPictureImaging.SaveAsTIFF(ImageID, "c:test.tif", TiffCompression.TiffCompressionAUTO)
    oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End Sub
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.