System.EntryPointNotFoundException:``找不到Gdi32.dll DLL的inde'CreateRoundRecRgn'''

时间:2019-04-08 06:44:15

标签: c#

我正在尝试Winform的转弯。尽管我安装了gdi32.dll,但出现类似System.EntryPointNotFoundException的错误:找不到“ Gdi32.dll” DLL'sinde'CreateRoundRecRgn'。有没有办法解决没有dll的问题或如何解决此问题?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.IO;



namespace UI
{
    public partial class UI : Form


    {
        [System.Runtime.InteropServices.DllImport("Gdi32.dll", EntryPoint = "CreateRoundRecRgn")]
        private static extern IntPtr CreateRoundRectRgn
            (
            int nLeftRect,          //x-coordiane of upper-left corner
            int nTopRect,           //y-coordiane of upper-left corner
            int nRightRect,         //x-coordiane of upper-left corner
            int nBottomRect,        //x-coordiane of lower-right corner
            int nWidthEllipse,      //x-width of ellipse
            int nHeightEllipse     //x-height of ellipse


            );
        [System.Runtime.InteropServices.DllImport("gdi32.dll", EntryPoint = "DeleObject")]
        private static extern bool DeleteObject(System.IntPtr hObject);

        int TogMove;
        int MValX;
        int MValY;

        public UI()
        {
            InitializeComponent();
            System.IntPtr ptr = CreateRoundRectRgn(0, 0, this.Width, this.Height, 50, 50);
            this.Region = System.Drawing.Region.FromHrgn(ptr);
            DeleteObject(ptr);

        }

1 个答案:

答案 0 :(得分:0)

您已将命名问题“ CreateRoundRecRgn”更改为此“ ​​CreateRoundRectRgn”