GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / DicomSelectPage Method
GdPicture image identifier. The multipage DICOM image.
Page number between 1 and page count.
Example





In This Topic
DicomSelectPage Method (GdPictureImaging)
In This Topic
Selects a page of a multipage DICOM image. The page can now be edited or saved to a different file.
Syntax
'Declaration
 
Public Function DicomSelectPage( _
   ByVal ImageID As Integer, _
   ByVal Page As Integer _
) As GdPictureStatus
public GdPictureStatus DicomSelectPage( 
   int ImageID,
   int Page
)
public function DicomSelectPage( 
    ImageID: Integer;
    Page: Integer
): GdPictureStatus; 
public function DicomSelectPage( 
   ImageID : int,
   Page : int
) : GdPictureStatus;
public: GdPictureStatus DicomSelectPage( 
   int ImageID,
   int Page
) 
public:
GdPictureStatus DicomSelectPage( 
   int ImageID,
   int Page
) 

Parameters

ImageID
GdPicture image identifier. The multipage DICOM image.
Page
Page number between 1 and page count.

Return Value

A member of the GdPictureStatus enumeration.
Example
Selecting pages of a dicom document.
Saving the pages of a dicom document to jpeg.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
 
    // Save each and every image to a jpeg.
    int pageCount = gdpictureImaging.DicomGetPageCount(imageID);
    for (int pageNo = 1; pageNo <= pageCount; pageNo++)
    {
        gdpictureImaging.DicomSelectPage(imageID, pageNo);
        gdpictureImaging.SaveAsJPEG(imageID, "image" + pageNo.ToString() + ".jpg", 75);
    }
 
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Saving the pages of a dicom document to an animated gif.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int dcmImageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
 
    // Create a gif with the first page.
    int gifImageID = gdpictureImaging.GifCreateMultiFrameFromGdPictureImage(dcmImageID);
 
    // Add the remaining pages as additional frames to the gif.
    int pageCount = gdpictureImaging.DicomGetPageCount(dcmImageID);
    for (int pageNo = 2; pageNo <= pageCount; pageNo++)
    {
        gdpictureImaging.DicomSelectPage(dcmImageID, pageNo);
        gdpictureImaging.GifAppendFrameFromGdPictureImage(gifImageID, dcmImageID);
    }
 
    gdpictureImaging.GifSaveMultiFrameToFile(gifImageID, "image.gif");
 
    gdpictureImaging.ReleaseGdPictureImage(gifImageID);
    gdpictureImaging.ReleaseGdPictureImage(dcmImageID);
}
See Also