xImage formats

Post Reply
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

xImage formats

Post by Silvio.Falconi »

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: xImage formats

Post by cnavarro »

Silvio.Falconi wrote:
.../...
and on other format ximage can be saved ?

I not seen save method on xImage class


But GDIBmp() Class, yes, have method ::Save()

{ "BMP", "JPG", "GIF", "TIF", "PNG" }
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

Sorry But I not understood

I ' m using XImage object
I have OimagePreview obj where I show the image , how I can save it on other format ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: xImage formats

Post by cnavarro »

Look, but it's possible not save with quality 100% in all formats

Code: Select all | Expand


//----------------------------------------------------------------------------//

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

//----------------------------------------------------------------------------//


 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

Cris run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: xImage formats

Post by nageswaragunupudi »

This is running ok for me

Code: Select all | Expand

  hIco  := ICON_EXEREAD( cFile, 4 )
   hBmp  := HBMPFROMHICON( hIco )
   DestroyIcon( hIco )
   oImage:SetSource( hBmp )
   DeleteObject( hBmp )
 


The function HBMPFROMHICON() is available in FWH library and this function also is contributed by Mr mastintin
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

Rao thanks now run ok
Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: xImage formats

Post by cnavarro »

Silvio.Falconi wrote:Cris run ok


Silvio, please use and try this function better

Code: Select all | Expand



//----------------------------------------------------------------------------//

Function SaveImg( oImg )

   local oBmp  := GdiBmp():New()
   oBmp:hBmp   := oImg:aPalBmp[ 1 ]
   ? oBmp:Save( "ejemplo0.png" )
   oBmp:End()

Return nil

//----------------------------------------------------------------------------//

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

I use this function

Code: Select all | Expand

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
 



I cannot believe xmage cannot save in other Graphics format
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: xImage formats

Post by cnavarro »

Silvio.Falconi wrote:
I cannot believe xmage cannot save in other Graphics format


This not a problem with XIMAGE, is GDIPLUS
It is possible that GDIPLUS supports other formats, I do not know, and maybe there is someone who can study if it can be saved in other formats.
Out of curiosity, what formats do you need?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6557
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Been thanked: 3 times

Re: xImage formats

Post by cnavarro »

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


Ah!, You are talking about showing this type of images with the XIMAGE class?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: xImage formats

Post by nageswaragunupudi »

FWH and XImage can display BMP, ICO, GIF, PNG, JPG, JPEG, TIF, TIFF on its own without freeimage.dll. If freeimage.dll exists in the path, it automatically uses fi.dll to display all other image formats too.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 7133
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 1 time

Re: xImage formats

Post by Silvio.Falconi »

CONFIRM

If I insert into path of my exe also freeimage.dll and run ok

I can show

pcx
tga

but I not show

pbm

I must control if freeimage open pbm files
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply