Examines a PhotoCD file to determine which resolutions it contains.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterCodecs
Dim fileName As String
Dim value() As Integer
value = instance.GetPcdResolution(fileName) |
Parameters
- fileName
- A System.String containing the name of the PhotoCD file.
Return Value
An array of 6 boolean values that specifies if the resolution at the corresponding index exists.
Example
This example checks for a high resolution PCD image and loads it if possible.
Visual Basic | Copy Code |
---|
Private Sub GetPcdResolutionExample(ByVal pcdFileName As String)
Dim codecs As RasterCodecs = New RasterCodecs()
' Get the PCD resolution information.
Const pcd4Base As Integer = 4
Dim resolutions As Integer() = codecs.GetPcdResolution(pcdFileName)
' Use high resolution if possible
If resolutions(pcd4Base) <> 0 Then
codecs.Options.Pcd.Load.Resolution = New LeadSize(1024, 1536)
Console.WriteLine("Loading Loading 1024 x 1536")
Else
codecs.Options.Pcd.Load.Resolution = New LeadSize(512, 768)
Console.WriteLine("Loading 512 x 768")
End If
' Load the image at its own bits per pixel
Dim image As RasterImage = codecs.Load(pcdFileName, 0, CodecsLoadByteOrder.Bgr, 1, 1)
Console.WriteLine("Image size loaded: {0} by {1}", image.Width, image.Height)
image.Dispose()
' Reset the default PCD resolution
codecs.Options.Pcd.Load.Resolution = New LeadSize(512, 768)
' Clean up
codecs.Dispose()
End Sub |
C# | Copy Code |
---|
void GetPcdResolutionExample(string pcdFileName)
{
RasterCodecs codecs = new RasterCodecs();
// Get the PCD resolution information.
const int pcd4Base = 4;
int[] resolutions = codecs.GetPcdResolution(pcdFileName);
// Use high resolution if possible
if(resolutions[pcd4Base] != 0)
{
codecs.Options.Pcd.Load.Resolution = new LeadSize(1024, 1536);
Console.WriteLine("Loading Loading 1024 x 1536");
}
else
{
codecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768);
Console.WriteLine("Loading 512 x 768");
}
// Load the image at its own bits per pixel
RasterImage image = codecs.Load(pcdFileName, 0, CodecsLoadByteOrder.Bgr, 1, 1);
Console.WriteLine("Image size loaded: {0} by {1}", image.Width, image.Height);
image.Dispose();
// Reset the default PCD resolution
codecs.Options.Pcd.Load.Resolution = new LeadSize(512, 768);
// Clean up
codecs.Dispose();
} |
SilverlightCSharp | Copy Code |
---|
|
SilverlightVB | Copy Code |
---|
|
Remarks
Requirements
Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)
See Also