I am attaching a drawing viewer written by Randall Rath, I would like to use this but I would like to understand how this works.
I am using this so I can have the same viewer for Autocad versio 2000-2006, I was using ACpreview for 2002
but i dont see this in ver 2005
I added comments for all the windows API function, I don't understand the block of code below
If Len(Dir(strFile)) > 0 Then
lngFile = FreeFile
Open strFile For Binary As lngFile
Seek lngFile, 14
Get lngFile, , lngImgLoc
Seek lngFile, lngImgLoc + 17
lngCurLoc = Seek(lngFile)
Seek lngFile, lngCurLoc + 4
Get lngFile, , bytCnt
If bytCnt > 1 Then
For intCnt = 1 To bytCnt
Get lngFile, , udtRec
If udtRec.bytType = 2 Then
'All of the code preceding this Line
'Is identical to the code in Part
'Two of Byte By Byte.
'Now we begin the color extraction
'The start value is the BYTE BEFORE
'The BMP Header data (The RGBQUAD
'And BMP Header are contained within
'Another structure), so move the read/
'Write marker to the next byte...
Seek lngFile, udtRec.lngStart + 1
'Pull out the BMP header data...
Get lngFile, , udtHeader
'Resize the Byte buffer to the full Length of the data...
ReDim bytBMPBuff(udtRec.lngLen)
'Did you read Randall's article?
If udtHeader.biBitCount = 8 Then
'Resize the array of RGBQuads, I
'Could also have used the biClrUsed
'Value of the udtHeader...
ReDim udtColors(256)
I would also like to understand how the size of the drawing view window is determined
see attached file for all of code.