help with PNG print

help with PNG print

Postby damianodec » Thu Jan 31, 2019 1:52 pm

hi to all,
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

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?
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: help with PNG print

Postby nageswaragunupudi » Thu Jan 31, 2019 2:56 pm

SCRINVERT ?
Should it not be SRCINVERT?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: help with PNG print

Postby damianodec » Thu Jan 31, 2019 3:07 pm

I defiened SCRINVERT on top of prg:
Code: Select all  Expand view
define SCRCOPY 0x00CC0020
#define SCRINVERT 0x00660046
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 414
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Rick Lipkin and 93 guests