Table of contents

Result Methods

Method Description
FreeDetectedQuadResultArray Releases memory allocated for CDetectedQuadResultArray.
FreeNormalizedImageResult Releases memory allocated for CNormalizedImageResult.
FreeString Releases memory allocated for a string.
SaveImageDataToFile Save the image data to a file.

FreeDetectedQuadResultArray

Releases memory allocated for CDetectedQuadResultArray.

static void dynamsoft::ddn::CDocumentNormalizer::FreeDetectedQuadResultArray(CDetectedQuadResultArray** results)

Parameters

[in] results An array of all detected quad results that needs to be released.

Code Snippet

CDocumentNormalizer ddn;
CDetectedQuadResultArray* detectedQuadResultArray = NULL;
ddn.DetectQuad("YOUR-SOURCE-FILE-PATH", "", &detectedQuadResultArray);
//...do something with the detectedQuadResultArray
if (detectedQuadResultArray != NULL)
    CDocumentNormalizer::FreeDetectedQuadResultArray(&detectedQuadResultArray);

FreeNormalizedImageResult

Releases memory allocated for CNormalizedImageResult.

static void dynamsoft::ddn::CDocumentNormalizer::FreeNormalizedImageResult(CNormalizedImageResult** result)

Parameters

[in] result The normalized image result that needs to be released.

Code Snippet

CDocumentNormalizer ddn;
CNormalizedImageResult* normalizedResult = NULL;
ddn.Normalize("YOUR-SOURCE-FILE-PATH", "", NULL, &normalizedResult);
//...do something with the normalizedResult
if (normalizedResult != NULL)
    CDocumentNormalizer::FreeNormalizedImageResult(&normalizedResult);

FreeString

Releases memory allocated for a string.

static void dynamsoft::ddn::CDocumentNormalizer::FreeString(char** content)

Parameters

[in] content The string that needs to be released.

Code Snippet

CDocumentNormalizer ddn;
char* content = NULL;
ddn.OutputRuntimeSettingsToString("", &content);
//...do something with the content
if (content != NULL)
    CDocumentNormalizer::FreeString(&content);

SaveImageDataToFile

Save the image data to a file.

static int dynamsoft::ddn::CDocumentNormalizer::SaveImageDataToFile(const CImageData* imageData, const char* filePath)

Parameters

[in] imageData The image data that needs to be saved.

[in] filePath The path of the output image file with the extension specifying the image format. It supports BMP and PNG files.

Code Snippet

CDocumentNormalizer ddn;
CNormalizedImageResult* normalizedResult = NULL;
ddn.Normalize("YOUR-SOURCE-FILE-PATH", "", NULL, &normalizedResult);
if (normalizedResult != NULL)
{   
    CDocumentNormalizer::SaveImageDataToFile(normalizedResult->GetImageData(), "YOUR-TARGET-FILE-PATH");
    CDocumentNormalizer::FreeNormalizedImageResult(&normalizedResult);
}

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: