예제 #1
0
파일: Image.cs 프로젝트: aruns/SpotiFire
        private Image(Session session, IntPtr imagePtr)
        {
            if (imagePtr == IntPtr.Zero)
            {
                throw new ArgumentException("imagePtr can't be zero.");
            }

            if (session == null)
            {
                throw new ArgumentNullException("Session can't be null.");
            }
            this.session        = session;
            this.imagePtr       = imagePtr;
            this.image_loaded   = new image_loaded_cb(ImageLoadedCallback);
            this.imageLoadedPtr = Marshal.GetFunctionPointerForDelegate(this.image_loaded);
            lock (libspotify.Mutex)
            {
                libspotify.sp_image_add_ref(imagePtr);
                libspotify.sp_image_add_load_callback(imagePtr, this.imageLoadedPtr, IntPtr.Zero);
            }

            session.DisposeAll += new SessionEventHandler(session_DisposeAll);
        }
예제 #2
0
 public static extern sp_error sp_image_remove_load_callback(IntPtr imagePtr, image_loaded_cb callback, IntPtr userDataPtr);
 public static extern sp_error sp_image_remove_load_callback(IntPtr imagePtr, image_loaded_cb callback, IntPtr userDataPtr);