Again, not sure it's a real problem... the image is big and up a certain point something must fail so probably a different approach should be used... but in any case seems to be a discrepancy if I didn't do something wrong in the code below, I'm not a big user of native bitmaps
edit: I think I've made a mistake, msdn says the DC to be used in CreateCompatibleBitmap() should be the original DC, not the one returned by CreateCompatibleDC(). That one must be used just for selecting the bitmap into it.
Changing the code accordingly
Code: Select all
pbimg = CreateImage(#PB_Any, 30000, 29560, 24) ; this fails on my PC too
Debug "PB image = " + pbimg ; 0 if failed
CreateImage(0, 1, 1, 24) ; a small dummy PB image
dc = StartDrawing(ImageOutput(0)) ; get the dc of the dummy PB image
Debug "PB image DC = " + dc
newdc = CreateCompatibleDC_(dc) ; get a compatible DC from the dummy, to be sure to do something equivalent
Debug "new DC = " + newdc
bmp=CreateCompatibleBitmap_(dc, 30000, 29560) ; they both fails
Debug SelectObject_(newdc, bmp)
StopDrawing()
Debug "API bitmap = " + bmp ; <> 0 if successful
Remain the question how other programs can open an image of this size....