0

C++ プロジェクトで、gdi+ ペンを作成します。c++ コード例:

long GetPen()
{
  Pen *pen = new Pen(Color.Red);

  return (long)pen; 
}

c# プロジェクトで、c++ プロジェクトで作成した gdi+ ペンを使用したい。 c# コード例:

[DllImport("xxxx.dll")]
public static extern IntPtr GetPen();

public void test()
{
   Intptr penptr = GetPen();

   //i want to convert the penptr to C# pen,is there any way?
}
4

0 に答える 0