■ GdipEmfToWmfBits API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
using System; using System.Runtime.InteropServices; #region GDI+ EMF→WMF 변환하기 - GdipEmfToWmfBits(emfHandle, bufferSize, bufferByteArray, mappingMode, flag) /// <summary> /// GDI+ EMF→WMF 변환하기 /// </summary> /// <param name="emfHandle">EMF 핸들</param> /// <param name="bufferSize">버퍼 크기</param> /// <param name="bufferByteArray">버퍼 바이트 배열</param> /// <param name="mappingMode">매핑 모드</param> /// <param name="flag">플래그</param> /// <returns>처리 결과</returns> [DllImport("gdiplus")] private static extern uint GdipEmfToWmfBits(IntPtr emfHandle, uint bufferSize, byte[] bufferByteArray, int mappingMode, EMFToWMFBitsFlag flag); #endregion /// <summary> /// EMF→WMF 비트 플래그 /// </summary> public enum EMFToWMFBitsFlag { /// <summary> /// Default /// </summary> Default = 0x00000000, /// <summary> /// Embed EMF /// </summary> EmbedEMF = 0x00000001, /// <summary> /// Include Placeable /// </summary> IncludePlaceable = 0x00000002, /// <summary> /// No XOR Clip /// </summary> NoXORClip = 0x00000004 }; |