I have my PRG that prints a lot of PNG files (about 500).
Function reads a TXT file whit PNG list and then print PNG inside FOR NEXT, thisi is code:
- Code: Select all Expand view RUN
PRINT oPrn NAME "PNG files" PREVIEW
...
for x = 1 to n
...
codice = oText:ReadLine()
// this function get in cNomeFilePng .PNG file to print
mrp006Bmp(codice, @cNomeFilePNG)
aBmp := WndReadPalBmpEx(nil, cNomeFilepng)
// from here
if BmpHeight(aBmp[1]) <> 0
nZoomH = 1250 / BmpHeight(aBmp[1])
endif
if nBmpWidth(aBmp[1]) <> 0
nZoomW = 2770 / nBmpWidth(aBmp[1])
endif
if nZoomW >= nZoomH
nFattore = nZoomH
else
nFattore = nZoomW
endif
// to here I get in nFattore the zoom factor
// here resize originale .PNG
u := ResizeBitmap( aBmp[ 1 ], nBmpWidth(aBmp[1])*nFattore, BmpHeight(aBmp[1])*nFattore, 3 )
DeleteObject( aBmp[1])
aBmp[ 1 ] := u
// in nRigaBmp and nColonnaBmp there is row and column to prin PNG
nRigaBmp = 314 + ((1259-(BmpHeight(aBmp[1])))/2)
nColonnaBmp = 3377 + ((2780-( nBmpWidth(aBmp[1])))/2)
// print PNG resized
DrawBitmap(oPrn:hDCOut, aBmp[1], nRigaBmp ,nColonnaBmp,0,0,SCRINVERT) // SCRINVERT
// and delete objects
DeleteObject( aBmp[1])
DeleteObject( aBmp[2])
DeleteObject( u )
* then I print others informations...
...
next
Print Preview works with about 200 files but with 500 files I get print preview with empty pages.
I think that is a memory issue due to bmp object, maybe deleteobject does not work.
Can you help me?