Sub AppendImage(cs As CSBuilder, bmp As Bitmap)
Dim attachment As NativeObject
attachment = attachment.Initialize("NSTextAttachment").RunMethod("new", Null)
attachment.SetField("image", bmp)
Dim nme As NativeObject = Me
'set bounds
nme.RunMethod("SetBounds::", Array(attachment, attachment.MakeRect(0, 0, 50, 100)))
Dim attributedString As NativeObject
attributedString = attributedString.Initialize("NSAttributedString") _
.RunMethod("attributedStringWithAttachment:", Array(attachment))
Dim no As NativeObject = cs
no.RunMethod("appendAttributedString:", Array(attributedString))
End Sub
#if OBJC
-(void)SetBounds:(NSTextAttachment*) attachment :(NSData*)data {
attachment.bounds = *(CGRect*)data.bytes;
}
#End If