At the beginning, in the local's declaration, add gState
Change this line
- Code: Select all Expand view RUN
- local image, oRect, nRet, aSize
as
- Code: Select all Expand view RUN
- local image, oRect, nRet, aSize, gState
Now locate these lines of code at the end of this method:
- Code: Select all Expand view RUN
- if !Empty( cUrl )
::SetLinkToURL( oRect:aRect, cURL )
endif
HPDF_Page_DrawImage( ::hPage, image, oRect:nLeft, ::nHeight - oRect:nTop - oRect:nHeight, ;
oRect:nWidth, oRect:nHeight /* iw, ih*/)
nRet := oRect:nBottom
::Pix2Units( nil, @nRet, , , cUnits )
return nRet
Replace it with these lines of code:
- Code: Select all Expand view RUN
- if !Empty( cUrl )
::SetLinkToURL( oRect:aRect, cURL )
endif
if nAlpha != nil
HPDF_Page_GSave( ::hPage )
gState := HPDF_CreateExtGState( ::hPdf )
HPDF_ExtGState_SetAlphaFill( gState, nAlpha/255 )
HPDF_Page_SetExtGState( ::hPage, gState )
endif
HPDF_Page_DrawImage( ::hPage, image, oRect:nLeft, ::nHeight - oRect:nTop - oRect:nHeight, ;
oRect:nWidth, oRect:nHeight /* iw, ih*/)
nRet := oRect:nBottom
::Pix2Units( nil, @nRet, , , cUnits )
if nAlpha != nil
HPDF_Page_GRestore( ::hPage )
endif
return nRet
You can now play with the alpha levels to your taste and get the results as you desire.