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 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
Visual Basic | Copy Code |
---|
RasterCodecs.GetPcdResolution
Private Sub GetPcdResolutionExample(ByVal pcdFileName As String)
RasterCodecs.Startup()
Dim codecs As RasterCodecs = New RasterCodecs()
Const pcd4Base As Integer = 4
Dim resolutions As Integer() = codecs.GetPcdResolution(pcdFileName)
If resolutions(pcd4Base) <> 0 Then
codecs.Options.Pcd.Load.Resolution = New Size(1024, 1536)
Console.WriteLine("Loading Loading 1024 x 1536")
Else
codecs.Options.Pcd.Load.Resolution = New Size(512, 768)
Console.WriteLine("Loading 512 x 768")
End If
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()
codecs.Options.Pcd.Load.Resolution = New Size(512, 768)
codecs.Dispose()
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
RasterCodecs.GetPcdResolution void GetPcdResolutionExample(string pcdFileName) { RasterCodecs.Startup(); 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 Size(1024, 1536); Console.WriteLine("Loading Loading 1024 x 1536"); } else { codecs.Options.Pcd.Load.Resolution = new Size(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 Size(512, 768); // Clean up codecs.Dispose(); RasterCodecs.Shutdown(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also