r/macosprogramming • u/B8edbreth • Jan 07 '24
Getting the Image data from scanner with ImageCaptureCore
So I've managed to get to the point where I can get my scanner to do an overview scan (or I guess if I called it instead I could do a regular scan.)
But I have a couple of problems
first in the scanner description there's a iconPath property but I cannot find any documentation on how to get a ICScannerDevice's properties.
Second, once the scan is done and
- (void)scannerDevice:(ICScannerDevice*)scanner didCompleteOverviewScanWithError:(NSError*)error
or
- (void)scannerDevice:(ICScannerDevice*)scanner didCompleteScanWithError:(NSError*)error
are called, how do you get a handle to the image data (more particularly a CGImageRef or NSImage) that was scanned? As near as I can tell there's only like 2 or 3 properties I can access from the device none of which are the scanned data or anything like that.
This is complicated by the fact I'm working in Objective C rather than swift. So I'm behind the curve here.
View all comments
Show parent comment
1
u/B8edbreth Jan 07 '24
I did try using your example code IU took screen shots but I can't upload them here. Bascially I have a device browser view, and a scanner device view in a window. The browser view shows my scanner and when I click it them click show info a new window appear but all the buttons are grayed out and nothing happens and my scanenr does not wake up. That's also what happens when I just run the example code you linked.