Code: Select all
TestImage = CreateImage(#PB_Any, 2550, 4200, 1)
hdc = CreateCompatibleDC_(0)
SelectObject_(hdc, ImageID(TestImage))
SetDIBColorTable_(hdc, 0, 2, @palette())
DeleteDC_(hdc) : hdc = 0
Code: Select all
TestImage = CreateImage(#PB_Any, 2550, 4200, 1)
hdc = CreateCompatibleDC_(0)
SelectObject_(hdc, ImageID(TestImage))
SetDIBColorTable_(hdc, 0, 2, @palette())
DeleteDC_(hdc) : hdc = 0
Code: Select all
hdc = CreateCompatibleDC_(0)
If hdc
With bmi.BITMAPINFO
\bmiHeader\biSize = SizeOf(BITMAPINFOHEADER)
\bmiHeader\biWidth = 300
\bmiHeader\biHeight = 300
\bmiHeader\biPlanes = 1
\bmiHeader\biBitCount = 1
EndWith
hBMP = CreateDIBSection_(hdc, @bmi, #DIB_RGB_COLORS, 0, 0, 0)
If hBMP
oldimage = SelectObject_(hdc, hBMP)
Dim colors.l(1)
colors(0) = #Black
colors(1) = #White
SetDIBColorTable_(hdc, 0, 2, @Colors())
SelectObject_(hdc, oldimage)
EndIf
DeleteDC_(hdc)
EndIf
Code: Select all
EncoderParameters\Count = 2
;
CopyMemory(?EncoderSaveFlag, @EncoderParameters\Parameter[0]\Guid, SizeOf(GUID))
EncoderParameters\Parameter[0]\type = 4
EncoderParameters\Parameter[0]\NumberOfValues = 1
EncoderParameters\Parameter[0]\Value = @ParameterValue
;
ColorDepth = 1
;
CopyMemory(?EncoderColorDepth, @EncoderParameters\Parameter[1]\Guid, SizeOf(GUID))
EncoderParameters\Parameter[1]\type = 4
EncoderParameters\Parameter[1]\NumberOfValues = 1
EncoderParameters\Parameter[1]\Value = @ColorDepth
Code: Select all
EncoderColorDepth:
Data.l $66087055
Data.w $AD66, $4C7C
Data.b $9A, $18, $38, $A2, $31, $0B, $83, $37