FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xImage formats
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
xImage formats
Posted: Mon Jan 08, 2018 06:13 PM

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 March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xImage formats
Posted: Mon Jan 08, 2018 06:46 PM
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Mon Jan 08, 2018 08:10 PM

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 March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xImage formats
Posted: Mon Jan 08, 2018 09:13 PM
Look, but it's possible not save with quality 100% in all formats

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Mon Jan 08, 2018 11:09 PM

Cris run ok

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xImage formats
Posted: Tue Jan 09, 2018 02:00 AM
This is running ok for me
Code (fw): Select all Collapse
   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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 08:56 AM
Rao thanks now run ok
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 02:23 PM
Silvio.Falconi wrote:Cris run ok


Silvio, please use and try this function better

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 05:00 PM
I use this function
Code (fw): Select all Collapse
 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 March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 05:11 PM
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 06:13 PM

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 March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 06:22 PM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xImage formats
Posted: Tue Jan 09, 2018 07:15 PM

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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: xImage formats
Posted: Tue Jan 09, 2018 09:49 PM
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 March-April 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

Continue the discussion