Re: [MBS] bitmapImageRepForCachingDisplayInRect
> My question: is there a way in MBSPlugins to do this and quickly convert > back to a Xojo Picture object? I've some sample code which gets the > bitmapImageRep and then converts it to a BMP and then use Picture.FromData(), > but this seems like it's probably a slow process. pass the handle to this method: CGImageMBS.CreateImageWithHandle(handle as integer) as CGImageMBS > Possibly related question: If I use declares and end up with a Ptr to a > NSImage (but not a NSImageMBS) is there any way to cast the Ptr to a > NSImageMBS so that I can then use MBS methods on it? use this method: NSImageMBS.imageWithHandle(Handle as Integer) as NSImageMBS Both classes have ways to get to Xojo picture. But you should avoid that and process it further, e.g. use JPEG functions on this classes. Sincerely Christian -- Read our blog about news on our plugins: http://www.mbsplugins.de/ ___ Mbsplugins_monkeybreadsoftware.info mailing list mbsplugins@monkeybreadsoftware.info https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
[MBS] bitmapImageRepForCachingDisplayInRect
Christian, there's example code floating around that uses bitmapImageRepForCachingDisplayInRect to get a "screenshot" of a NSView - and it seems like it's more likely to pick up content such as HTMLViewers. (See https://forum.xojo.com/17847-yosemite-and-overlaymbs-fadetransition-can-t-capture-vibrancy/p1#p148223 for example) My question: is there a way in MBSPlugins to do this and quickly convert back to a Xojo Picture object? I've some sample code which gets the bitmapImageRep and then converts it to a BMP and then use Picture.FromData(), but this seems like it's probably a slow process. Possibly related question: If I use declares and end up with a Ptr to a NSImage (but not a NSImageMBS) is there any way to cast the Ptr to a NSImageMBS so that I can then use MBS methods on it? ___ Mbsplugins_monkeybreadsoftware.info mailing list mbsplugins@monkeybreadsoftware.info https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info