Hello,
saving a bitmap and testing the possible combinations, using :
oDrawImg:SaveImage( cFilename, nExport )
the alphachannel will be lost.
Is there another solution, saving a painted image ( BMP or PNG ) with a included alphachannel ?
I think something from FREEIMAGE.dll is missing in class TImage.
Testing with sample : Testimg.prg
Load a alphablended BMP and change the button from JPG to BMP, to view the result :
@ 5, 28 BUTTON "Save" SIZE 50, 10 OF oDlg ;
ACTION ( oImage:SaveImage( "SAVED.BMP", 0, 25 ), MsgInfo( "saved as saved.bmp" ) )
The painting ( two merged alphablended bmp's ) :
The preview of the EXPORT-result ( with lost alpha-channel ) :
I can use NCONVERT for saving ( with possible resize ),
but it only saves the MAIN-images ( file ) without the painted / merged second one or any other paintings.
The alphachannel is saved as well with this solution.
cScript := '-quiet -o ' + cNewFile + ' -ratio -rtype lanczos -resize ' + ;
ALLTRIM(STR(nExpWidth)) + ' ' + ;
ALLTRIM(STR(nExpHeight)) + ' -overwrite ' + ALLTRIM(cImagepath) + cWorkfile
CursorWait()
WAITRUN ( "NConvert " + cScript, 0 )
Using a NON alphablended BMP as MAIN-image, works fine !
The painting ( a merged alphablended bmp on JPG ) :
The preview of the exported image( BMP with alpha-channel on JPG ) :
Best regards
Uwe