I need to move a picture (actually copy it verbatim) into another picture object… and I’d like to do it faster than Drawpicture does it (which is faster, I’m hoping for faster).
I have perused MacOSLib … but my biggest problem is lack of adequate comments… tons of code, but unless you “know” what it does, you are hard pressed to figure out if it does what you want…
The NSImage code has a bunch of stuff using NSImage, CGImage etc…
I just need something that would do :
myNewPicture=Copy_Of(Old_Picture)
and when complete I’d have TWO picture object (NOT two pointers to the same instance)
Right now I do it this way
w=OldPicture.width
h=OldPicture.height
myNewPicture=New picture(w,h,32)
g=myNewPicture.graphics
// this is so the picture is not altered due to Cocoa interpolations
Declare Sub CGContextSetInterpolationQuality Lib "Cocoa" ( context As Integer, quality As Integer )
CGContextSetInterpolationQuality( g.handle( g.HandleTypeCGContextRef ),0 )
g.DrawPicture old_picture,0,0,w,h,0,0,w,h