using (GdPictureSegmenter gdpictureSegmenter = new GdPictureSegmenter()) { gdpictureSegmenter.SegmentationMode= SegmentationMode.WordLayout; gdpictureSegmenter.InputValue = "words"; //Set up the image you want to process. using (GdPictureImaging gdpictureImaging = new GdPictureImaging()) { //The standard open file dialog displays to allow you to select the file. int image = gdpictureImaging.CreateGdPictureImageFromFile("d:\\wordimage.png"); if ((gdpictureImaging.GetStat() == GdPictureStatus.OK) && (gdpictureSegmenter.SetImage(image) == GdPictureStatus.OK) && (gdpictureSegmenter.SetROI(10,10,55,55)== GdPictureStatus.OK)) { //Run the segmentation process. string result = gdpictureSegmenter.RunSegmentation(); if (gdpictureSegmenter.GetStat() == GdPictureStatus.OK) { //You can do your another stuff with gdpictureSegmenter here. } else { MessageBox.Show("The segmentation process has failed with the status: " + gdpictureSegmenter.GetStat().ToString(), caption); } //Release the used image. gdpictureImaging.ReleaseGdPictureImage(image); } else { MessageBox.Show("The error occurred when setting up the image: " + gdpictureImaging.GetStat().ToString() + " or " + gdpictureSegmenter.GetStat().ToString(), caption); } } }