I will try to make a function to do it.mol wrote: how to output generated image to png/jpg file?
Is it possible?
Best Regards,
Claudio.
Moderator: Rathinagiri
I will try to make a function to do it.mol wrote: how to output generated image to png/jpg file?
Is it possible?
Code: Select all
#include "freeimag.ch"
...
LOCAL oImg
...
/* Init FreeImage */
fi_Initialise()
...
oImg := fi_Load( FIF_BMP, 'AnyFile.bmp', BMP_DEFAULT )
// oImg := fi_Load( FIF_JPEG, 'AnyFile.jpg', JPEG_DEFAULT )
// oImg := fi_Load( FIF_PNG, 'AnyFile.png', PNG_DEFAULT )
// oImg := fi_Load( FIF_TIFF, 'AnyFile.tif', TIFF_DEFAULT )
// oImg := fi_Load( FIF_GIF, 'AnyFile.gif', GIF_DEFAULT )
...
fi_Save( FIF_BMP, oImg, 'NewFile.bmp', BMP_DEFAULT )
fi_Save( FIF_JPEG, oImg, 'NewFile.jpg', JPEG_DEFAULT )
fi_Save( FIF_PNG, oImg, 'NewFile.png', PNG_DEFAULT )
fi_Save( FIF_TIFF, oImg, 'NewFile.tif', TIFF_DEFAULT )
fi_Save( FIF_GIF, oImg, 'NewFile.gif', GIF_DEFAULT )
...
/* Unload Image */
fi_Unload( oImg )
...
/* End FreeImage */
fi_Deinitialise()
...
Hi Marek,srvet_claudio wrote:I will try to make a function to do it.mol wrote: how to output generated image to png/jpg file?
Is it possible?
Best Regards,
Claudio.
Code: Select all
hBitmap := Proc_Create_Logo ()
#define BT_FILEFORMAT_BMP 0
#define BT_FILEFORMAT_JPG 1
#define BT_FILEFORMAT_GIF 2
#define BT_FILEFORMAT_TIF 3
#define BT_FILEFORMAT_PNG 4
BT_SAVE_GDIPLUS_IMAGE (hBitmap, "LOGO_BMP.bmp", BT_FILEFORMAT_BMP)
BT_SAVE_GDIPLUS_IMAGE (hBitmap, "LOGO_JPG.jpg", BT_FILEFORMAT_JPG)
BT_SAVE_GDIPLUS_IMAGE (hBitmap, "LOGO_GIF.gif", BT_FILEFORMAT_GIF)
BT_SAVE_GDIPLUS_IMAGE (hBitmap, "LOGO_TIF.tif", BT_FILEFORMAT_TIF)
BT_SAVE_GDIPLUS_IMAGE (hBitmap, "LOGO_PNG.png", BT_FILEFORMAT_PNG)
rathinagiri wrote:That is just fantastic Claudio.
Thanks Rathi and Marek.mol wrote:Super!
You are really Speedy Gonzales
Yes of course, would be a nice app.rathinagiri wrote:I think it will now be possible for one to create a simple image viewer and tweaker software.
Thanks Pablo.Pablo César wrote:Wow Dr. !!
Creating images files here in MHG ??? Fantastic !
Congratulations !
Code: Select all
/*****************************************************************************/
Procedure ON_PAINT_Incomming()
/*****************************************************************************/
LOCAL nWidth := BT_ClientAreaWidth ("Incomming")
LOCAL nHeight := BT_ClientAreaHeight ("Incomming")
LOCAL hDC, BTstruct , nTypeText
nTypeText := BT_TEXT_OPAQUE + BT_TEXT_BOLD + BT_TEXT_UNDERLINE + BT_TEXT_ITALIC
hDC = BT_CreateDC ("Incomming", BT_HDC_INVALIDCLIENTAREA, @BTstruct)
BT_FillRectangle (hDC, 100 , 2 , nWidth , nHeight , GREEN , GREEN , 1 )
BT_FillRoundRect (hDC, 190 , 445 , 575 , 410 , 8, 8 , GREEN , WHITE , 2)
Return