C code need help loading picture automatically

mamashi

New Member
Joined
Jun 23, 2010
Messages
1
I need help. I would like someone to help me how can i make the program selecte the picture let say picture 01 till picture 02 by squence on each picture it has to read a number on the picture let say 01 and then picture two 02 ....etc.

I need to know how can i read those number without using the loading the picture it mean it will do it automatically instead each time the pop ask me to load the picture and then i have to use my OCR to read the number but my concern is just i need to able to load the picture wihtout using the pop loader as i do it now manually.

it mean it read the number automatically without showing the picture. I included the code below maybe someone can help me and it is on C code only. thanks a lot mamashi


int main (int argc, char *argv[])
{
int success = 1;
int err = 0;
char** imagePath; // Image Path
int cancelled;
ImageType imageType; // Image Type
Image* image; // Image

// IMAQ Vision creates windows in a separate thread
imaqSetWindowThreadPolicy(IMAQ_SEPARATE_THREAD);
// Display the Load Image dialog
imagePath = imaqLoadImagePopup(NULL, "*.*", NULL, "Open Image", FALSE, IMAQ_BUTTON_LOAD, 0, 0, 1, 0, &cancelled, NULL);
if (!cancelled)
{
// Get the type of the image file to create an image of the right type
imaqGetFileInfo(imagePath[0], NULL, NULL, NULL, NULL, NULL, &imageType);
// Create an IMAQ Vision image
image = imaqCreateImage(imageType, 7);
// Read the image from disk
imaqReadFile(image, imagePath[0], NULL, NULL);
// Vision Assistant Algorithm
success = IVA_ProcessImage(image);
if (!success)
err = imaqGetLastError();
// Display the image
imaqMoveWindow(DISPLAY_WINDOW, imaqMakePoint(0,0));
imaqSetWindowPalette(DISPLAY_WINDOW, IMAQ_PALETTE_GRAY, NULL, 0);
imaqDisplayImage(image, DISPLAY_WINDOW, TRUE);
// Wait for a key press before exiting
printf ("Press Enter to exit.\n");
getchar();
// Dispose resources
imaqDispose(image);
}
imaqDispose(imagePath);
return 0;
}
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You would probably have more luck if you tried a C programming forum. Here we do Excel/Access and VBA associated with those.
 
Upvote 0

Forum statistics

Threads
1,225,510
Messages
6,185,386
Members
453,289
Latest member
ALPOINT_AIG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top