AGI STK Graphics 11 Send comments on this topic.
WriteExtentAndSubExtentTransparentColorString Method (IAgStkGraphicsJpeg2000WriterInitializer)
See Also  Example
ImageUri
The image filename to be converted. Only file URIs are supported.
Extent
An array representing the Cartographic Extent of the image. The elements should be provided in the order west longitude, south latitude, east longitude, north latitude. The extent can be null if the image defines the extent as with a GeoTIFF image.
SubExtent
If a sub-extent is specified, only part of the image defined by the sub-extent is converted. The elements should be provided in the order west longitude, south latitude, east longitude, north latitude.
CompressionProfile
The compression profile.
CompressionRate
A higher compression rate results in smaller JPEG 2000 files. Use 1 for no compression. Valid values are 1 to 65535.
Jpeg2000Uri
The JPEG 2000 filename. Only file URIs are supported.
OverwriteExistingFile
If true and the JPEG 2000 file already exists, the file will be overwritten during the conversion.
TransparentColor
Any color in the image that matches the transparent color will be made transparent.





Description

Converts an image, such as a BMP, to a GeoJP2 file that can be used as an image globe overlay. The extent of the image can be defined as an input parameter if necessary.

Syntax

[Visual Basic .NET]
Public Sub WriteExtentAndSubExtentTransparentColorString( _
   ByVal ImageUri As String, _
   ByRef Extent As System.Array, _
   ByRef SubExtent As System.Array, _
   ByVal CompressionProfile As AgEStkGraphicsJpeg2000CompressionProfile, _
   ByVal CompressionRate As Integer, _
   ByVal Jpeg2000Uri As String, _
   ByVal OverwriteExistingFile As Boolean, _
   ByVal TransparentColor As System.Drawing.Color _
) 

[C#]
public void WriteExtentAndSubExtentTransparentColorString(
string ImageUri,
ref System.Array Extent,
ref System.Array SubExtent,
AgEStkGraphicsJpeg2000CompressionProfile CompressionProfile,
int CompressionRate,
string Jpeg2000Uri,
bool OverwriteExistingFile,
System.Drawing.Color TransparentColor
);

[Managed C++]
public: void WriteExtentAndSubExtentTransparentColorString(
String __gc ^ ImageUri,
System::Array ^^ Extent,
System::Array ^^ SubExtent,
AgEStkGraphicsJpeg2000CompressionProfile CompressionProfile,
int CompressionRate,
String __gc ^ Jpeg2000Uri,
bool OverwriteExistingFile,
uint ^ TransparentColor
);

[Java]
public  writeExtentAndSubExtentTransparentColorString(
String ImageUri,
Object[] Extent,
Object[] SubExtent,
AgEStkGraphicsJpeg2000CompressionProfile CompressionProfile,
ppInteger CompressionRate,
String Jpeg2000Uri,
bool OverwriteExistingFile,
long TransparentColor
);

[Unmanaged C++]
public: HRESULT WriteExtentAndSubExtentTransparentColorString(
BSTR ImageUri,
SAFEARRAY ** Extent,
SAFEARRAY ** SubExtent,
AgEStkGraphicsJpeg2000CompressionProfile CompressionProfile,
int CompressionRate,
BSTR Jpeg2000Uri,
VARIANT_BOOL OverwriteExistingFile,
uint * TransparentColor
);

Parameters

ImageUri
The image filename to be converted. Only file URIs are supported.
Extent
An array representing the Cartographic Extent of the image. The elements should be provided in the order west longitude, south latitude, east longitude, north latitude. The extent can be null if the image defines the extent as with a GeoTIFF image.
SubExtent
If a sub-extent is specified, only part of the image defined by the sub-extent is converted. The elements should be provided in the order west longitude, south latitude, east longitude, north latitude.
CompressionProfile
Member Value Description
eStkGraphicsJpeg2000CompressionProfileDefault 0 This is the default profile, which is recommended for those unfamiliar with the others.
eStkGraphicsJpeg2000CompressionProfileNITF_BIIF_NPJE 1 This profile is designed for U.S. and NATO military applications.
eStkGraphicsJpeg2000CompressionProfileNITF_BIIF_EPJE 2 This profile is designed for U.S. and NATO military applications. Based on NPJE, the profile is used for image exploitation, and improves image read times for lower resolutions in large images as compared to NPJE.
The compression profile.
CompressionRate
A higher compression rate results in smaller JPEG 2000 files. Use 1 for no compression. Valid values are 1 to 65535.
Jpeg2000Uri
The JPEG 2000 filename. Only file URIs are supported.
OverwriteExistingFile
If true and the JPEG 2000 file already exists, the file will be overwritten during the conversion.
TransparentColor
Any color in the image that matches the transparent color will be made transparent.

Example

Shows the format of the Extent and SubExtent parameters when writing using a Jpeg 2000 Writer.
[C#] Copy Code
Array extent = new object[] 

    -1
    -1
    1
    1 
}; 
 
Array subExtent = new object[] 

    -0.5
    -0.5
    0.5
    0.5 
}; 
 
sceneManager.Initializers.Jpeg2000Writer.WriteExtentAndSubExtentString( 
    imagePath, 
    ref extent, 
    ref subExtent, 
    AgEStkGraphicsJpeg2000CompressionProfile.eStkGraphicsJpeg2000CompressionProfileDefault, 
    1
    saveFile, 
    true); 
 

Shows the format of the Extent and SubExtent parameters when writing using a Jpeg 2000 Writer.
[Visual Basic .NET] Copy Code
Dim extent As Array = New Object() {-1, -1, 1, 1}

Dim subExtent As Array = New Object() {-0.5, -0.5, 0.5, 0.5}

sceneManager.Initializers.Jpeg2000Writer.WriteExtentAndSubExtentString(imagePath, extent, subExtent, AgEStkGraphicsJpeg2000CompressionProfile.eStkGraphicsJpeg2000CompressionProfileDefault, 1, saveFile, _
    True)

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1