Hello,
If you are using AppKit and you want to create a new NSBitmapImageRep
from a CGImage
using the constructor in your Xamarin.Mac
project, you could refer to the following code:
var image = new NSImage("setting.png");// I create a NSImage to get the CGImage
var nsBitmapImageRep = new NSBitmapImageRep(image.CGImage);// this parameter is your CGImage
You also could check the API at https://learn.microsoft.com/en-us/dotnet/api/appkit.nsbitmapimagerep?view=xamarin-mac-sdk-14
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.