Determining If Page Has a Certain Color?

Discussions about image processing and document imaging.
Post Reply
stanlyn
Posts: 25
Joined: Wed Mar 05, 2014 8:29 pm

Determining If Page Has a Certain Color?

Post by stanlyn » Mon Mar 10, 2014 8:26 am

Hi,

What are the functions needed to determine if a certain color exists on a page?

We have a folder where hundreds of multi-page invoices were scanned in as individual single page files. They were scanned in numeric order. We can tell what the starting page is as it has the yellow highlighter color on them, while the other pages that belongs to that invoice does not. All these images were scanned in color as .jpgs.

What would the process be using com?

Thanks, Stanley

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Determining If Page Has a Certain Color?

Post by Loïc » Mon Mar 10, 2014 2:58 pm

Hello,

See method CountColor() https://www.gdpicture.com/guides/gdpicture/web ... Color.html

With best regards,

Loïc

stanlyn
Posts: 25
Joined: Wed Mar 05, 2014 8:29 pm

Re: Determining If Page Has a Certain Color?

Post by stanlyn » Thu Mar 13, 2014 4:46 pm

Hi Loic,

I'm getting an error when running this CountColor function code in VFP9sp2. See the attached screenshot of the debugger messages. I'd suspect that it needs the enum for one of the functions as it cannot resolve its name because you are not using header or #include libraries. I also cannot find the enum or constants list for this.

ImageID = 0
YellowCount = 0
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("L:\temp\yellow.jpg")

If ImageID <> 0
YellowCount = oGdPictureImaging.CountColor(ImageID, oGdPictureImaging.ARGB(255, 0,255, 0))
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
Messagebox("Could not load document: " + Alltrim(Str(oGdPictureImaging.GetStat(),6,0)))
Endif

Thanks,
Stanley

stanlyn
Posts: 25
Joined: Wed Mar 05, 2014 8:29 pm

Re: Determining If Page Has a Certain Color?

Post by stanlyn » Thu Mar 13, 2014 4:51 pm

Sorry Loic,

Here is the message details...

message = "OLE error code 0x80020006: Unknown name"
message1 = "YellowCount = oGdPictureImaging.CountColor_ImageID, oGdPictureImaging.ARGB(255,0,255,0))"

Stanley

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Determining If Page Has a Certain Color?

Post by Loïc » Mon Mar 17, 2014 7:51 pm

Hello,

The CountColor() method is not exposed in the COM/ActiveX version. We will add it for the next minor release.

With best regards,

Loïc

stanlyn
Posts: 25
Joined: Wed Mar 05, 2014 8:29 pm

Re: Determining If Page Has a Certain Color?

Post by stanlyn » Tue Mar 18, 2014 2:44 am

Thanks Loic!

Stanley

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest