As I understood,
GDIP_IMAGEFROMFILE( cFile, .T. )
can now be used to load an image without FREEIMAGE.DLL. Is there something similar to SAVE an image?
EMG
As I understood,
GDIP_IMAGEFROMFILE( cFile, .T. )
can now be used to load an image without FREEIMAGE.DLL. Is there something similar to SAVE an image?
EMG
Enrico,
Manuel (Mastintin) is our GDI master. Lets see what he can tell us.
local cImage := "image.bmp"
local
local oGdi := GDIBmp():new( cImage )
oGdi:save( "imagenfinal.png")
oGdi:end()Thank you. I'm going to experiment with it.
EMG
Ok, it's working, thank you.
EMG
REQUEST GDIBMP
FUNCTION LOADIMG( cFile )
  IF !FILE( cFile )
    RETURN 0
  ENDIF
  RETURN GDIP_IMAGEFROMFILE( cFile, .T. )
FUNCTION SAVEIMG( cSrcFile, cDstFile )
  LOCAL aExt := { "BMP", "JPG", "GIF", "TIF", "PNG" }
  LOCAL aIds := { "{557CF400-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF401-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF402-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF405-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF406-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF403-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF404-1A04-11D3-9A73-0000F81EF32E}",;
          "{557CF407-1A04-11D3-9A73-0000F81EF32E}" }
  LOCAL cExt := CFILEEXT( cDstFile )
  LOCAL nExt := ASCAN( aExt, cExt )
  LOCAL cId := aIds[ nExt ]
  LOCAL hImg := GDIPLUSIMAGELOADCACHEDFILE( cSrcFile )
  IF hImg = 0 THEN RETURN .F.
  GDIPLUSIMAGESAVE( hImg, ANSITOWIDE( cDstFile ), ANSITOWIDE( cId ) )
  DELETEOBJECT( hImg )
  RETURN .T.Enrico Maria Giordano wrote:These are a couple of functions I wrote:
[code=fw]
GDIPLUSIMAGESAVE( hImg, ANSITOWIDE( cDstFile ), ANSITOWIDE( cId ) )
EMG
I've already tried: it doesn't work without ANSITOWIDE().
EMG
  LOCAL hImg := GDIPLUSIMAGELOADCACHEDFILE( cSrcFile )
  IF hImg = 0 THEN RETURN .F.
  GDIPLUSIMAGESAVE( hImg, ANSITOWIDE( cDstFile ), ANSITOWIDE( cId ) )
  DELETEOBJECT( hImg )[/quote]GDIP_DELETEIMAGE( hImg )Enrico Maria Giordano wrote:[quote="Enrico Maria Giordano"  LOCAL hImg := GDIPLUSIMAGELOADCACHEDFILE( cSrcFile )   IF hImg = 0 THEN RETURN .F.   GDIPLUSIMAGESAVE( hImg, ANSITOWIDE( cDstFile ), ANSITOWIDE( cId ) )   DELETEOBJECT( hImg )[/quote]
Do I have to use
GDIP_DELETEIMAGE( hImg )
instead to release the image, right? Can you confirm this?
EMG
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL cSrcImage := "c:\fwh\bitmaps\magic.bmp"
LOCAL cDstImage := "magic.gif"
LOCAL oGdi := GDIBmp():New( cSrcImage )
oGdi:Save( cDstImage )
oGdi:End()
RETURN NILEnrico . No more news.
to solve the problem, we first have to develop code for octree algorithm and my c ++ does not go that far. I have c ++ code that is done but do not get removed compile errors.
However, the GIF format is licensed for use and is overwhelmed by png or tif.
If anyone is encouraged... your code is this ....
https://www.dropbox.com/s/3syub4enpg5lx ... r.cpp?dl=0
Cheers
Do you have QColorQuantizer.h?
EMG
Error 404 (Page not found). ![]()
EMG