Wich ext support xImage ?
I saw of docx,xlsx,pptx and emf,wmf,jpg,jpeg,bmp
and on other format ximage can be saved ?
I not seen save method on xImage class
Silvio.Falconi wrote:
.../...
and on other format ximage can be saved ?
I not seen save method on xImage class
{ "BMP", "JPG", "GIF", "TIF", "PNG" }
//----------------------------------------------------------------------------//
Function SaveImg( oImg )
local oBmp := GdiBmp():New()
oBmp:hBmp := GDIP_FROMHBITMAP( oImg:GetHBitmap(), oImg:aPalBmp[ 1 ], .T. )
? oBmp:Save( "ejemplo.png" )
oBmp:End()
Return nil
//----------------------------------------------------------------------------//
hIco := ICON_EXEREAD( cFile, 4 )
hBmp := HBMPFROMHICON( hIco )
DestroyIcon( hIco )
oImage:SetSource( hBmp )
DeleteObject( hBmp )
Silvio.Falconi wrote:Cris run ok
//----------------------------------------------------------------------------//
Function SaveImg( oImg )
local oBmp := GdiBmp():New()
oBmp:hBmp := oImg:aPalBmp[ 1 ]
? oBmp:Save( "ejemplo0.png" )
oBmp:End()
Return nil
//----------------------------------------------------------------------------//
Function SalvaImage(oImg)
Local nType
local oBmp := GdiBmp():New()
local cFile := cGetFile( "Bitmap (*.bmp)| *.bmp|" + ;
"JPEG (*.jpg)| *.jpg|" + ;
"GIF (*.gif)| *.gif|" + ;
"TIFF (*.tif)| *.tif|" + ;
"PNG (*.png)| *.png" ;
,"Salva con il nome", hb_CurDrive() , .t. )
* oBmp:hBmp := GDIP_FROMHBITMAP( oImg:GetHBitmap(), oImg:aPalBmp[ 1 ], .T. )
oBmp:hBmp := oImg:aPalBmp[ 1 ]
IF .NOT. EMPTY( cFile )
nType := NGETFILEFILTER()
DO CASE
CASE nType == 1
cExt := "bmp"
CASE nType == 2
cExt := "jpg"
CASE nType == 3
cExt := "gif"
CASE nType == 4
cExt := "tif"
CASE nType == 5
cExt := "png"
ENDCASE
cFile := cFilePath( cFile ) + cFileNoExt( cFile ) + "." + cExt
oBmp:Save(cfile)
MsgInfo( "saved as: "+ cFile)
oBmp:End()
Endif
Return nil
Silvio.Falconi wrote:
I cannot believe xmage cannot save in other Graphics format
Silvio.Falconi wrote:Now I have a strange problem
Sometimes xmage not read some graphics files . I made a folder with the most format and I have problems to show them
for a sample I have problems to show :
tga
tif
emf
pbm
pcx
while I can show
jpg
jpeg
bmp
gif
png
this can happen if the computer does not open those formats but if I use the paint or infarview I can open them all.
With Image I could open all files with ximage I have limitations
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 58 guests