GDI画条码,这还真没怎么耍过。

解决方案 »

  1.   

        using DWORD = Int32;
        using HDC = Int32;
        using LPWSTR = String;
        using LPRECT = Rectangle;    public partial class X32
        {
            [DllImport("Barcode.dll", CharSet = CharSet.Unicode)]
            static extern DWORD DrawBarcode(
                HDC hDc,
                [MarshalAs(UnmanagedType.LPWStr | UnmanagedType.VBByRefStr)] ref LPWSTR TEXT,
                [MarshalAs(UnmanagedType.LPWStr | UnmanagedType.VBByRefStr)] ref LPWSTR Starstopchar,
                [MarshalAs(UnmanagedType.LPWStr | UnmanagedType.VBByRefStr)] ref LPWSTR facename,
                [MarshalAs(UnmanagedType.LPWStr | UnmanagedType.VBByRefStr)] ref LPWSTR buffer,
                ref LPRECT bounds,
                ref LPRECT barcodematrix,
                int textwidth,
                int texheight,
                int textbobarcode,
                int textquiezone,
                int barinflate,
                DWORD color,
                DWORD @params
                );
      

  2.   


    HDC->DWORD->4BYTE->INT
    WCHAR*->wchar_t*->LPWSTR->SYSINT
    LPRECT->RECT*->SYSINT