Private Sub Command2_Click()
Dim Pos As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim color As Long
'this is the original file's setting
Pic1bit.bmih.biSize = 40
Pic1bit.bmih.biWidth = 42
Pic1bit.bmih.biHeight = 50
Pic1bit.bmih.biPlanes = 1
Pic1bit.bmih.biBitCount = 1
Pic1bit.bmih.biCompression = 0& ' RGB
Pic1bit.bmih.biSizeImage = 400
Pic1bit.bmih.biXPelsPerMeter = 3780
Pic1bit.bmih.biYPelsPerMeter = 3780
Pic1bit.bmih.biClrUsed = 0
Pic1bit.bmih.biClrImportant = 0
Pic1bit.bmfh.bfOffBits = 62
Pic1bit.bmfh.bfType = &H4D42
Pic1bit.bmfh.bfSize = 462
Pic1bit.bmfh.bfReserved1 = 0
Pic1bit.bmfh.bfReserved2 = 0
ReDim Pic1bit.aColors(0 To 1)
Pic1bit.aColors(0).B = 0: Pic1bit.aColors(0).G = 0: Pic1bit.aColors(0).R = 0: Pic1bit.aColors(0).Reserved = 0
Pic1bit.aColors(1).B = 255: Pic1bit.aColors(1).G = 255: Pic1bit.aColors(1).R = 255: Pic1bit.aColors(1).Reserved = 0
ReDim Pic1bit.aBitmapBits(0 To Pic1bit.bmih.biSizeImage - 1)
For i = 0 To Pic1bit.bmih.biSizeImage - 1
'let say i have a picture need to be save as monochrome is loaded
'in a picture box called picBmp.
'i think i should grab the image data from the picture box
' and #put it in the binary file.
'so i've tried like this and i got stuck here........
For j = 0 To picBmp.ScaleWidth - 1
For k = 0 To picBmp.ScaleHeight - 1
color = picBmp.Point(i, j)
'stuck here.......
Next k
Next j
Next
Open "C:\Temp.bmp" For Binary As #1
Put #1, , Pic1bit.bmfh
Put #1, , Pic1bit.bmih
Put #1, , Pic1bit.aColors
Put #1, , Pic1bit.aBitmapBits ' dim as byte
Close #1
End Sub