de wathsnew.txt
* New: function FIMakeThumbNail( cSrcFile, cDstFile, nPixel ) --> lOk thanks to
Carlos Vargas:
viewtopic.php?p=155418#p155418
Carlos Vargas
Desde Managua, Nicaragua (CA)
* New: function FIMakeThumbNail( cSrcFile, cDstFile, nPixel ) --> lOk thanks to
Carlos Vargas:
viewtopic.php?p=155418#p155418
Carlos,
incluido, muchas gracias! ![]()
Respecto a esto tengo una buena noticia ...para eso no necesitamos FreeImage , por lo menos en 32bits....
en gdiplus.cpp :
HB_FUNC( GDIPLUSIMAGECREATETHUMB )
{
Bitmap * newImage = ( Bitmap * ) hb_parnl( 1 );
int nWidth = hb_parni( 2 );
int nHeight = hb_parni( 3 );
Image * hThumb = newImage->GetThumbnailImage( nWidth , nHeight, NULL, NULL );
hb_retnl( ( HB_LONG ) hThumb );
}
en Tgdiplus.prg :
METHOD CreateThumbnail( nWidth, nHeight ) CLASS GDIBmp
local oThumb:= gdiBmp():new()
local hImage := GdiPlusImageCreateThumb( ::hbmp, nWidth, nHeight )
oThumb:hBmp := hImage
Return oThumb
Function GDIPlusSaveThumbnail( cImageIni, cImageEnd , nWhidth, nHeight )
local cExtIni := Upper(cFileExt( cImageIni ))
local oImage:= GDIBmp():New( cImageIni )
local oThumb
local nScan
if( nScan:= aScan( oImage:aExtIni, cExtIni )) == 0
Msginfo( " el archivo "+ cImageIni + " tiene un formato no soportado")
return .f.
endif
oThumb:= oImage:CreateThumbmail( nWhidth, nHeight )
oThumb:Save( cImageEnd )
oImage:Destroy()
oThumb:Destroy()
return nil
mastintin wrote:Respecto a esto tengo una buena noticia ...para eso no necesitamos FreeImage , por lo menos en 32bits....
en gdiplus.cpp :
HB_FUNC( GDIPLUSIMAGECREATETHUMB )
{
Bitmap * newImage = ( Bitmap * ) hb_parnl( 1 );
int nWidth = hb_parni( 2 );
int nHeight = hb_parni( 3 );
Image * hThumb = newImage->GetThumbnailImage( nWidth , nHeight, NULL, NULL );
hb_retnl( ( HB_LONG ) hThumb );
}
en Tgdiplus.prg :
METHOD CreateThumbnail( nWidth, nHeight ) CLASS GDIBmp
local oThumb:= gdiBmp():new()
local hImage := GdiPlusImageCreateThumb( ::hbmp, nWidth, nHeight )
oThumb:hBmp := hImage
Return oThumb
Function GDIPlusSaveThumbnail( cImageIni, cImageEnd , nWhidth, nHeight )
local cExtIni := Upper(cFileExt( cImageIni ))
local oImage:= GDIBmp():New( cImageIni )
local oThumb
local nScan
if( nScan:= aScan( oImage:aExtIni, cExtIni )) == 0
Msginfo( " el archivo "+ cImageIni + " tiene un formato no soportado")
return .f.
endif
oThumb:= oImage:CreateThumbmail( nWhidth, nHeight )
oThumb:Save( cImageEnd )
oImage:Destroy()
oThumb:Destroy()
return nil
Function GDIPlusSaveThumbnail( cImageIni, cImageEnd , nWhidth, nHeight )
local lSw := .T.
local cExtIni := Upper(cFileExt( cImageIni ))
local oImage:= GDIBmp():New( cImageIni )
local oThumb
local nScan
if( nScan:= aScan( oImage:aExtIni, cExtIni )) == 0
Msginfo( " el archivo "+ cImageIni + " tiene un formato no soportado")
//return .f.
lSw := .F.
else
oThumb:= oImage:CreateThumbmail( nWhidth, nHeight )
oThumb:Save( cImageEnd )
oImage:Destroy()
oThumb:Destroy()
endif
return lSwCristobal , tienes raz贸n , ya lo he cambiado en mi c贸digo . Gracias por el apunte.
Ahora falta conseguir que funcione la creacion de bitmaps gdi+ desde stream que abre muchas posibilidades ya que permitir铆a cargar Imagenes gdi+ desde una url y desde recursos y luego pasarlos a bmps gdi pero mi c++ no da para ello
.Guardar imagenes png en recursos en vez bmps de 32bits y usarlos como si fueran bmps normales sin usar freeImage seria estupendo.
Manuel,
Si publicas el c贸digo actualizado lo voy actualizando en FWH ![]()
C++ ? Tu puedes con eso y mucho m谩s ![]()