当前位置: 首页>>代码示例>>C#>>正文


C# System.IntPtr类代码示例

本文整理汇总了C#中System.IntPtr的典型用法代码示例。如果您正苦于以下问题:C# IntPtr类的具体用法?C# IntPtr怎么用?C# IntPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IntPtr类属于System命名空间,在下文中一共展示了IntPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetRawInternal

 internal static byte[] GetRawInternal(IntPtr pointer)
 {
     var ret = new byte[PyString_Size(pointer)];
     var buffer = PyString_AsString(pointer);
     Marshal.Copy(buffer, ret, 0, ret.Length);
     return ret;
 }
开发者ID:yushiro,项目名称:beliEVE,代码行数:7,代码来源:PyString.cs

示例2: BitmapDrawableResource

		public unsafe BitmapDrawableResource (global::Android.Graphics.Drawables.BitmapDrawable p0, global::Com.Bumptech.Glide.Load.Engine.Bitmap_recycle.IBitmapPool p1)
			: base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
		{
			if (Handle != IntPtr.Zero)
				return;

			try {
				JValue* __args = stackalloc JValue [2];
				__args [0] = new JValue (p0);
				__args [1] = new JValue (p1);
				if (GetType () != typeof (BitmapDrawableResource)) {
					SetHandle (
							global::Android.Runtime.JNIEnv.StartCreateInstance (GetType (), "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V", __args),
							JniHandleOwnership.TransferLocalRef);
					global::Android.Runtime.JNIEnv.FinishCreateInstance (Handle, "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V", __args);
					return;
				}

				if (id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_ == IntPtr.Zero)
					id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_ = JNIEnv.GetMethodID (class_ref, "<init>", "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V");
				SetHandle (
						global::Android.Runtime.JNIEnv.StartCreateInstance (class_ref, id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_, __args),
						JniHandleOwnership.TransferLocalRef);
				JNIEnv.FinishCreateInstance (Handle, class_ref, id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_, __args);
			} finally {
			}
		}
开发者ID:thanhdatbkhn,项目名称:GlideXamarinBinding,代码行数:27,代码来源:Com.Bumptech.Glide.Load.Resource.Bitmap.BitmapDrawableResource.cs

示例3: Capture

 public Pixels Capture(IntPtr windowHandle)
 {
     Bitmap bmp = ScreenCapture.CaptureWindow(windowHandle);
     Pixels pixels = BitmapToPixels(bmp);
     bmp.Dispose();
     return pixels;
 }
开发者ID:CodesInChaos,项目名称:Go-Audio-Lesson-Tool,代码行数:7,代码来源:VideoCapture.cs

示例4: get_tweenTargets

public static int get_tweenTargets(IntPtr L)
{
UIButtonColorExt self = Funcs.GetObj(L,1) as UIButtonColorExt;
if(self == null)
{
	LuaStatic.traceback(L,"nullobj call");
	LuaDLL.lua_error(L); return 1;
}
{
int i0 = 0;
LuaDLL.lua_newtable(L);
foreach(UnityEngine.GameObject item0 in self.tweenTargets)
{
if(item0 == null)  LuaStatic.addGameObject2Lua(L,null,""); else
{
LuaStatic.addGameObject2Lua(L,item0, "GameObject");
}
++i0;
LuaDLL.lua_pushnumber(L,i0);
LuaDLL.lua_insert(L,-2);
LuaDLL.lua_settable(L,-3);
}
}
return 1;
}
开发者ID:fengqk,项目名称:Art,代码行数:25,代码来源:LuaUIButtonColorExt.cs

示例5: n_City_Ljava_lang_String_

		static IntPtr n_City_Ljava_lang_String_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0)
		{
			global::Com.Baidu.Mapapi.Search.Sug.SuggestionSearchOption __this = global::Java.Lang.Object.GetObject<global::Com.Baidu.Mapapi.Search.Sug.SuggestionSearchOption> (jnienv, native__this, JniHandleOwnership.DoNotTransfer);
			string p0 = JNIEnv.GetString (native_p0, JniHandleOwnership.DoNotTransfer);
			IntPtr __ret = JNIEnv.ToLocalJniHandle (__this.City (p0));
			return __ret;
		}
开发者ID:lq-ever,项目名称:CommunityCenter,代码行数:7,代码来源:Com.Baidu.Mapapi.Search.Sug.SuggestionSearchOption.cs

示例6: MarshalNativeToManaged

		public object MarshalNativeToManaged (IntPtr pNativeData)
		{
			string s = UnixMarshal.PtrToString (pNativeData, UnixEncoding.Instance);
			// Console.WriteLine ("# FileNameMarshaler.MarshalNativeToManaged ({0:x})=`{1}'",
			// 		pNativeData, s);
			return s;
		}
开发者ID:Jakosa,项目名称:MonoLibraries,代码行数:7,代码来源:FileNameMarshaler.cs

示例7: Close

 /// <summary>
 /// デバイスをクローズする
 /// </summary>
 public void Close()
 {
     if ( DeviceReady ) {
         Native.CloseHandle( hDev );
         hDev = IntPtr.Zero;
     }
 }
开发者ID:kencr,项目名称:HIDSimpleFramework,代码行数:10,代码来源:USBDevice.cs

示例8: FilterFunc

        private FilterReturn FilterFunc(IntPtr xevent, Event evnt)
        {
            if (xevent == IntPtr.Zero)
                return FilterReturn.Continue;

            var e = (X11.XEvent)Marshal.PtrToStructure(xevent, typeof(X11.XEvent));

            // Dropping these events is non standard but so is embeding a Gtk into
            // a X11 Window.
            if (e.type == X11.XEventName.FocusOut ||
                e.type == X11.XEventName.LeaveNotify)
            {
                return FilterReturn.Remove;
            }

            // Ensure Mouse clicks and Button go to the right place
            if (e.type == X11.XEventName.ButtonPress ||
                e.type == X11.XEventName.KeyPress)
            {
                // TODO: possibly cancel any tooltip windows.

                this.m_parent.Focus();
                return FilterReturn.Continue;
            }

            // Everything else just process as normal
            return FilterReturn.Continue;
        }
开发者ID:GTWebSoftware,项目名称:OpenGeckoSharp,代码行数:28,代码来源:GtkReparentingWrapperNoThread.cs

示例9: GetShellFolder

 public static IShellFolder GetShellFolder(IntPtr ptrShellFolder)
 {
     System.Type shellFolderType = GetShellFolderType();
     Object obj = Marshal.GetTypedObjectForIUnknown(ptrShellFolder,shellFolderType);
     IShellFolder RetVal = (IShellFolder)obj;
     return RetVal;
 }
开发者ID:kaloutsa,项目名称:maksudproject,代码行数:7,代码来源:ShellFunctions.cs

示例10: State

		public static int State(IntPtr L)
		{
			string err;
			try
			{
				IntPtr idptr = LuaDLL.lua_touserdata(L, 1);
				System.Object obj = default(System.Object);
				Animation self = default(Animation);
				if (objs.TryGetValue(idptr.ToInt32(), out obj))
					self = objs[idptr.ToInt32()] as Animation;
				else
				{
					LuaStatic.traceback(L);
					LuaDLL.lua_error(L);
					return 1;
				}
				string statename = LuaDLL.lua_tostring(L, 2);
				AnimationState state = self[statename];
				if (state == null)
				{
					LuaDLL.lua_pushnil(L);
				}
				else
					LuaStatic.addGameObject2Lua(L, state, "AnimationState");
				return 1;
			}
			catch (Exception e)
			{
				err = e.ToString();
			}
			LuaStatic.traceback(L, err);
			LuaDLL.lua_error(L);
			return 1;
		}
开发者ID:fengqk,项目名称:Art,代码行数:34,代码来源:LuaAnimation2.cs

示例11: DragToDataObject

		internal static DataObject DragToDataObject (IntPtr dragref) {
			UInt32 items = 0;
			ArrayList flavorlist = new ArrayList ();

			CountDragItems (dragref, ref items);
			
			for (uint item_counter = 1; item_counter <= items; item_counter++) {
				IntPtr itemref = IntPtr.Zero;
				UInt32 flavors = 0;
				
				GetDragItemReferenceNumber (dragref, item_counter, ref itemref);
				CountDragItemFlavors (dragref, itemref, ref flavors);
				for (uint flavor_counter = 1; flavor_counter <= flavors; flavor_counter++) {
					FlavorHandler flavor = new FlavorHandler (dragref, itemref, flavor_counter);
					if (flavor.Supported)
						flavorlist.Add (flavor);
				}
			}

			if (flavorlist.Count > 0) {
				return ((FlavorHandler) flavorlist [0]).Convert (flavorlist);
			} 

			return new DataObject ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:Dnd.cs

示例12: XcbSurface

		public XcbSurface (IntPtr connection, uint drawable, IntPtr visual, int width, int height)
		{
			surface = CairoAPI.cairo_xcb_surface_create (connection, drawable, visual, width, height);
			lock (surfaces.SyncRoot) {
				surfaces [surface] = this;
			}
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:7,代码来源:XcbSurface.cs

示例13: IntPtrCopy

		public static int IntPtrCopy(IntPtr source, Stream dest, int length)
		{
			var buffer = new Byte[length];
			Marshal.Copy(source, buffer, 0, length);
			dest.Write(buffer, 0, length);
			return length;
		}
开发者ID:WimVergouwe,项目名称:ravendb,代码行数:7,代码来源:RdcBufferTools.cs

示例14: FromBitmap

		public static XcbSurface FromBitmap (IntPtr connection, uint bitmap, IntPtr screen, int width, int height)
		{
			IntPtr ptr;

			ptr = CairoAPI.cairo_xcb_surface_create_for_bitmap (connection, bitmap, screen, width, height);
			return new XcbSurface (ptr, true);
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:7,代码来源:XcbSurface.cs

示例15: create_datawriter

 public static extern IntPtr create_datawriter(
     IntPtr _this,
     IntPtr a_topic,
     IntPtr qos,
     IntPtr a_listener,
     StatusKind mask
     );
开发者ID:shizhexu,项目名称:opensplice,代码行数:7,代码来源:Publisher.cs


注:本文中的System.IntPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。