Message 1 of 2
Display drawing file on a Windows form with VB.NET
Not applicable
06-23-2011
06:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've created a Windows form with a Picture box and I wish to display a block drawing in the Picture box, or another Windows control if that is appropriate.
When running the code lines:
Dim oImage As System.Drawing.Image = System.Drawing.Image.FromFile(sDrawingName)
PictureBox1.Image = oImage
I get an "out of Memory" error report.
This code works quite well if I use a GIF file, rather than a DWG file, so I guess I need another approach.
Web searches have proved useless. I did find a C# project at:
http://through-the-interface.typepad.com/.m/through_the_interface/2008/06/autocad-net-ver.html, but I'm unable to get it to run or to work out which of the C# code is relevant.