FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour help with PNG print
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
help with PNG print
Posted: Thu Jan 31, 2019 01: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 (fw): Select all Collapse
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 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: help with PNG print
Posted: Thu Jan 31, 2019 02:56 PM

SCRINVERT ?
Should it not be SRCINVERT?

Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: help with PNG print
Posted: Thu Jan 31, 2019 03:07 PM
I defiened SCRINVERT on top of prg:
Code (fw): Select all Collapse
define SCRCOPY 0x00CC0020
#define SCRINVERT 0x00660046
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)

Continue the discussion