private ImageSource GetThumbnail() { var image = new Image(); if (this.comment.HasViewPoint()) { BC_ViewPoint viewPoint = this.comment.GetViewPoint(); if (viewPoint.HasSnapShot()) { BC_SnapShot snapShot = viewPoint.GetSnapShot(); uint imageSize = snapShot.GetThumbnailSize(); if (snapShot.HasImage()) { var imageArray = new byte[(int)imageSize]; snapShot.GetThumbnail(imageArray, imageSize); using (var stream = new MemoryStream(imageArray)) { image.Source = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); } } } } return(image.Source); }
public BC_SnapShot GetSnapShot() { global::System.IntPtr cPtr = BIMcollab_ViewPointPINVOKE.BC_ViewPoint_GetSnapShot(swigCPtr); BC_SnapShot ret = (cPtr == global::System.IntPtr.Zero) ? null : new BC_SnapShot(cPtr, false); return(ret); }
public BC_SnapShot GetDefaultSnapShot() { global::System.IntPtr cPtr = BIMcollab_IssuePINVOKE.BC_Issue_GetDefaultSnapShot(swigCPtr); BC_SnapShot ret = (cPtr == global::System.IntPtr.Zero) ? null : new BC_SnapShot(cPtr, false); if (BIMcollab_IssuePINVOKE.SWIGPendingException.Pending) { throw BIMcollab_IssuePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
private ImageSource GetIssueSnapshot() { var image = new Image(); uint numberOfComments = this.issue.GetNumberOfComments(); if (numberOfComments == 0) { return(image.Source); } uint latestCommentIndex = numberOfComments - 1; BC_Comment comment = this.issue.GetCommentByIndex(latestCommentIndex); if (comment.HasViewPoint()) { BC_ViewPoint viewPoint = comment.GetViewPoint(); if (viewPoint.HasSnapShot()) { BC_SnapShot snapShot = viewPoint.GetSnapShot(); uint imageSize = snapShot.GetImageSize(); if (snapShot.HasImage()) { var imageArray = new byte[(int)imageSize]; snapShot.GetImage(imageArray, imageSize); using (var stream = new MemoryStream(imageArray)) { image.Source = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); } } } } return(image.Source); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BC_SnapShot obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }