Determining If Page Has a Certain Color?
Determining If Page Has a Certain Color?
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
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
Re: Determining If Page Has a Certain Color?
Hello,
See method CountColor() https://www.gdpicture.com/guides/gdpicture/web ... Color.html
With best regards,
Loïc
See method CountColor() https://www.gdpicture.com/guides/gdpicture/web ... Color.html
With best regards,
Loïc
Re: Determining If Page Has a Certain Color?
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
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
Re: Determining If Page Has a Certain Color?
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
Here is the message details...
message = "OLE error code 0x80020006: Unknown name"
message1 = "YellowCount = oGdPictureImaging.CountColor_ImageID, oGdPictureImaging.ARGB(255,0,255,0))"
Stanley
Re: Determining If Page Has a Certain Color?
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
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
Re: Determining If Page Has a Certain Color?
Thanks Loic!
Stanley
Stanley
Who is online
Users browsing this forum: No registered users and 2 guests