as for cocoa you can easily use âCGWindowListCreateImageâ to capture entire screen and get a picture object
from a CGImage.
const kCGWindowListOptionAll = 0
const kCGNullWindowID = 0
const kCGWindowImageDefault = 0
soft declare sub CGContextDrawImage lib "Carbon" (context as Ptr, rect as NSRect, image as Ptr)
soft declare function CGWindowListCreateImage lib "Carbon" (r as CGRect, windowList as integer, winID as integer, winImageOptions as integer) as ptr
dim s as CGRect = CGMakeRect(0,0,Screen(0).width, screen(0).height)
dim p as ptr = CGWindowListCreateImage(s, kCGWindowListOptionAll, kCGNullWindowID, kCGWindowImageDefault)
dim thePic as new Picture(s.w,s.h)
CGContextDrawImage ptr(thepic.Graphics.Handle(Graphics.HandleTypeCGContextRef)),s, p
You can do that too. Iâve used it in my app to capture whatâs behind. Sometime I have a suspicion that
you comment or post only to place your own plugins/ads.
I have been using it for a while, then I switched to ScreenRectMBS, which is cross platform and faster. But indeed, there are different solutions available.
[quote=41547:@Mike Cotrone]Michael this code from my method I have used. HTH also.
[code]
Dim pict As Picture
Dim d as new Date
// Create Timestamp for ScreenCapture Save Name
Dim timeStamp as string = str(d.Minute) + str(d.Second)
Dim f as FolderItem = GetSaveFolderItem(âimage/pngâ,âScreenCapture_â + timeStamp + â.pngâ)
If f <> Nil then
pict = New Picture(self.Width, self.Height, 32)
Self.DrawInto pict.Graphics, 0, 0
pict.Save(f, Picture.SaveAsPNG)
end if
[/code][/quote]