Reading thumbnail from a 2013 dwg file

Reading thumbnail from a 2013 dwg file

FRFR1426
Collaborator Collaborator
987 Views
1 Reply
Message 1 of 2

Reading thumbnail from a 2013 dwg file

FRFR1426
Collaborator
Collaborator

I know how to read the BMP thumbnail (there are some code here: http://forums.autodesk.com/t5/NET/Another-DWGThumbnail-post/m-p/3007970/highlight/true#M23445), but in 2013, the BMP has been replaced by a PNG. The type seems to be 6 instead of 2 (BMP), but I don't know how the PNG is stored (I've not made further investigation).

 

Does anyone here have the code or some information about it?

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
988 Views
1 Reply
Reply (1)
Message 2 of 2

FRFR1426
Collaborator
Collaborator

I've found it:

 

fs.Seek(udtRec.lngStart, SeekOrigin.Begin)
Using ms As New MemoryStream
    fs.CopyTo(ms, udtRec.lngStart)
    img = Image.FromStream(ms)
End Using

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes