xImage formats

xImage formats

Postby Silvio.Falconi » Mon Jan 08, 2018 6: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 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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby cnavarro » Mon Jan 08, 2018 6: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xImage formats

Postby Silvio.Falconi » Mon Jan 08, 2018 8: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 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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby cnavarro » Mon Jan 08, 2018 9:13 pm

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

Code: Select all  Expand view

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

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
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xImage formats

Postby Silvio.Falconi » 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 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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby nageswaragunupudi » Tue Jan 09, 2018 2:00 am

This is running ok for me
Code: Select all  Expand view
  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
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xImage formats

Postby Silvio.Falconi » Tue Jan 09, 2018 8:56 am

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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby cnavarro » Tue Jan 09, 2018 2:23 pm

Silvio.Falconi wrote:Cris run ok


Silvio, please use and try this function better

Code: Select all  Expand view


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

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
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xImage formats

Postby Silvio.Falconi » Tue Jan 09, 2018 5:00 pm

I use this function
Code: Select all  Expand view
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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby cnavarro » Tue Jan 09, 2018 5: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xImage formats

Postby Silvio.Falconi » Tue Jan 09, 2018 6: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 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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: xImage formats

Postby cnavarro » Tue Jan 09, 2018 6: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: xImage formats

Postby nageswaragunupudi » Tue Jan 09, 2018 7: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xImage formats

Postby Silvio.Falconi » Tue Jan 09, 2018 9: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 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
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests