How To Do


How can I use a bitmap cursor with DXFReader.NET Component?


Use the following code:

            openFileDialog1.Filter = "Image files (*.jpg, *.png, *.bmp)|*.jpg;*.png;*.bmp";
            openFileDialog1.Filter +="| JPEG (*.jpg)|*.jpg|PNG (*.png)|*.png|BMP (*.bmp)|*.bmp"
            openFileDialog1.FileName = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Bitmap bitmap = new Bitmap(openFileDialog1.FileName);
                bitmap.MakeTransparent(bitmap.GetPixel(00));
                Graphics g = Graphics.FromImage(bitmap);
                IntPtr ptr = bitmap.GetHicon();
                dxfReaderNETControl1.CustomCursor = CustomCursorType.None;
                dxfReaderNETControl1.Cursor = new Cursor(ptr);

            }


Warning!
All samples, data, places and images in this section are only for tutorial. They are fictitious and may not correspond to real cases.

Any similarities to actual persons or places is merely coincidental.