In my application, i am sending my desktop screenshot to web service by converting it to base64 string. Here is the code to obtain the screenshot.
CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault);
Now i want to convert this screenshot to base64 string format. Can anyone provide the solution to convert my screenshot to base64 string format.
Note: conversion from NSImage/NSData to base64 string format also acceptable.