Image x xImage quality difference
Image x xImage quality difference
Hi.
I noted a difference in quality between Image and xImage controls.
In the below samples, the first one is an Image and the last is a xImage.
And the original image is this Tiff image http://farmacia.com.br/lixo/Image.tif.
xImage has many more options to manipulate images and I would like to use it.
My question is, is it possible to use a xImage control with an Image object ?
I don't need to edit the image, only show, rotate, zoom, move, etc...
I saw that xImage can be used with EMF and WMF meta files, is this a way ?
Does any one can point me the path ?
Regards,
Maurício Ventura Faria
I noted a difference in quality between Image and xImage controls.
In the below samples, the first one is an Image and the last is a xImage.
And the original image is this Tiff image http://farmacia.com.br/lixo/Image.tif.
xImage has many more options to manipulate images and I would like to use it.
My question is, is it possible to use a xImage control with an Image object ?
I don't need to edit the image, only show, rotate, zoom, move, etc...
I saw that xImage can be used with EMF and WMF meta files, is this a way ?
Does any one can point me the path ?
Regards,
Maurício Ventura Faria
Re: Image x xImage quality difference
Asi es, ximage te da muchas buenas opciones.
Tienes un buen ejemplo en los samples de Fivewin.
ximage01.prg
Tienes un buen ejemplo en los samples de Fivewin.
ximage01.prg
Code: Select all | Expand
#include "fivewin.ch"
//----------------------------------------------------------------------------//
function Main()
local aImages, oWnd, oFont, oBrush, oBrw, oImage
FW_SetUnicode( .t. )
HB_SETCODEPAGE( "UTF8" ) // Harbour (not xHarbour) to display unicode filenames
aImages := ReadFolder()
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-15
DEFINE BRUSH oBrush FILE "..\bitmaps\backgrnd\stone.bmp"
DEFINE WINDOW oWnd
oWnd:SetFont( oFont )
DEFINE BUTTONBAR oWnd:oBar SIZE 100,32 2007
SET MESSAGE OF oWnd TO "" 2007
DEFINE BUTTON OF oWnd:oBar PROMPT "Center" CENTER ACTION ( oImage:Center(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Width" CENTER ACTION ( oImage:FitWidth(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Height" CENTER ACTION ( oImage:FitHeight(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Rect" CENTER ACTION ( oImage:FitRect(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Rotate" CENTER ACTION ( oImage:Rotate(), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Zoom" CENTER ACTION ( MsgInfo( "Zoom/Unzoom with Mouse Wheel" ), oImage:SetFocus() )
DEFINE BUTTON OF oWnd:oBar PROMPT "Pan/Move" CENTER ACTION ( MsgInfo( "Drag with Mouse" ), oImage:SetFocus() )
@ oWnd:oBar:nHeight,0 XBROWSE oBrw SIZE 300,-oWnd:oMsgBar:nHeight ;
PIXEL OF oWnd DATASOURCE aImages COLUMNS 1 ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:nStretchCol := 1
:bChange := { || oImage:Refresh() }
//
:CreateFromCode()
END
@ oWnd:oBar:nHeight,300 XIMAGE oImage SIZE 0,-oWnd:oMsgBar:nHeight ;
OF oWnd SOURCE MEMOREAD( oBrw:aRow[ 2 ] )
oImage:SetBrush( oBrush )
WITH OBJECT oWnd
:nWidth := ScreenWidth() * 0.6
:nHeight := ScreenHeight() * 0.6
END
ACTIVATE WINDOW oWnd CENTERED
RELEASE FONT oFont
RELEASE BRUSH oBrush
return nil
//----------------------------------------------------------------------------//
static function ReadFolder
local aImages := {}
local aSub := { "AlphaBmp\", "hires\", "pngs\" }
local c, cPath, aDir
for each c in aSub
cPath := "..\bitmaps\" + c
aDir := Directory( cPath + "*.*" )
AEval( aDir, { |a| If( a[ 2 ] > 32000, AAdd( aImages, { a[ 1 ], TrueName( cPath + a[ 1 ] ) } ), nil ) } )
next
ASort( aImages,,,{ |x,y| Lower( x[ 1 ] ) < Lower( y[ 1 ] ) } )
return aImages
//----------------------------------------------------------------------------//
Re: Image x xImage quality difference
Yes, I am aware of that.cmsoft wrote:Asi es, ximage te da muchas buenas opciones.
My question is about quality of the image on screen.
And xImage is worse than Image for the same TIF image file.
Re: Image x xImage quality difference
Concentra, compare você mesmo. Eu prefiro usar IMAGE.
https://forums.fivetechsupport.com/view ... 8d#p227197
https://www.fivetechsoft.com/forums/vie ... hp?t=37301
https://www.fivetechsoft.com/forums/vie ... hp?t=37389
Regards, saludos.
https://forums.fivetechsupport.com/view ... 8d#p227197
https://www.fivetechsoft.com/forums/vie ... hp?t=37301
https://www.fivetechsoft.com/forums/vie ... hp?t=37389
Code: Select all | Expand
// C:\FWH\SAMPLES\TESTIMG2.PRG
#include "FiveWin.ch"
FUNCTION Main()
LOCAL oDlg, oImage
DEFINE DIALOG oDlg SIZE 800, 600 PIXEL TRUEPIXEL RESIZABLE TITLE "XIMAGE"
@ 00, 30 BUTTON "SELECT" SIZE 80, 30 PIXEL OF oDlg ACTION SetImage( oImage )
@ 50, 30 XIMAGE oImage SIZE 500, 500 OF oDlg
oImage:lCanPaste := .T.
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
FUNCTION SetImage( oImage )
LOCAL cFile := cGetFile( "|*.tif|" )
LOCAL hIco, hBmp
oImage:SetSource( cFile )
RETURN NIL
/*
FUNCTION Main() // usando IMAGE
LOCAL oDlg, oImg
// DEFINE IMAGE oImg FILENAME "..\bitmaps\olga1.jpg"
DEFINE IMAGE oImg FILENAME "image.tif"
DEFINE DIALOG oDlg TITLE "Image background"
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oDlg:SetSize( oImg:nWidth, oImg:nHeight ), oDlg:Center() ) ;
ON PAINT PalBmpDraw( hDC, 0, 0, oImg:hBitmap )
oImg:End()
RETURN NIL
*/
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Image x xImage quality difference
Então Karinha, comparei...karinha wrote:Concentra, compare você mesmo. Eu prefiro usar IMAGE.
Image tem melhor qualidade na tela ( preciso disso ) e xImage tem mais recursos e funções.
No final acho que vou usar o Image e "chupar" as funções da classe xImage que eu preciso.
[[]]
Maurício Ventura Faria
P.S. Vai Curinthia!
Re: Image x xImage quality difference
hahahahahahahaha.Maurício Ventura Faria
P.S. Vai Curinthia!
Thamus junthos!!! hahahahahahaha,
Abs.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Image x xImage quality difference
I am not able to get the image from this address.And the original image is this Tiff image http://farmacia.com.br/lixo/Image.tif.
Can you make this image available to me please?
I would like to test with TImage and TXImage and see what can be done to improve the quality.
Or if possible can you send the Tif file to my email
nageswaragunupudi [at] gmail [dot] com
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Image x xImage quality difference
This is kind of weird. The image is there...nageswaragunupudi wrote:I am not able to get the image from this address.And the original image is this Tiff image http://farmacia.com.br/lixo/Image.tif.
Sent.if possible can you send the Tif file to my email
nageswaragunupudi [at] gmail [dot] com
See a sample test code:
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
Local oWnd
LOCAL oImage
LOCAL oXImage
PARAMETER cFile
IF EMPTY(cFile)
cFile := "Image.tif"
ENDIF
DEFINE WINDOW oWnd FROM 1,1 TO GetSysMetrics(1)-400,GetSysMetrics(0)-1200 TITLE "FiveWin Images" PIXEL
@ 1,1 IMAGE oImage SIZE (oWnd:nWidth/2)-30,oWnd:nHeight-90 FILE cFile OF oWnd
oImage:nZoom := ( (oWnd:nWidth/2)-30 ) / nBmpWidth( oImage:hBitmap )
@ 14,(GetSysMetrics(0)-1200)/2 XIMAGE oXImage SIZE (oWnd:nWidth/2)-30,oWnd:nHeight-90 FILE cFile OF oWnd
oXImage:FitWidth()
ACTIVATE WINDOW oWnd
oImage:End()
Return nil
[[]] Maurício Ventura Faria
Re: Image x xImage quality difference
nageswaragunupudi wrote:I would like to test with TImage and TXImage and see what can be done to improve the quality.
Take a look at this code:
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
Local oWnd
LOCAL oImage
LOCAL oImage2
LOCAL oXImage
PARAMETER cFile
IF EMPTY(cFile)
cFile := "Image.tif"
ENDIF
DEFINE WINDOW oWnd FROM 1,1 TO GetSysMetrics(1)-400,GetSysMetrics(0)-1200 TITLE "FiveWin Images" PIXEL
@ 1,1 IMAGE oImage SIZE (oWnd:nWidth/2)-30,oWnd:nHeight-90 FILE cFile OF oWnd
oImage:nZoom := ( (oWnd:nWidth/2)-30 ) / nBmpWidth( oImage:hBitmap )
oImage2 := TImage():New(,,,,, cFile, .F., oWnd,,, .F., .F.,,, .F.,, .F.,, .F., "oImage2" )
@ 14,(GetSysMetrics(0)-1200)/2 XIMAGE oXImage SIZE (oWnd:nWidth/2)-30,oWnd:nHeight-90 SOURCE oImage2:hBitmap OF oWnd
oXImage:FitWidth()
ACTIVATE WINDOW oWnd
oImage:End()
Return nil
If I am correct, I took the handle of an Image object and used it as source of a xImage object and the quality in the screen are is the same.
This make me thinking that the issue can be only when showing the image on screen.
[[]]
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Image x xImage quality difference
This is a very old statement that you should never use anymore. Replace it with a LOCAL statement. Anyway, I just tested your sample with XIMAGE and found no difference between the results using IMAGE and XIMAGE. How to reproduce the problem?concentra wrote:Code: Select all | Expand
PARAMETER cFile
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Image x xImage quality difference
I noticed some issues with regards to the Tif file he sent me. I am working on it.with XIMAGE and found no difference between the results using IMAGE and XIMAGE. How to reproduce the problem?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Image x xImage quality difference
Enrico,Enrico Maria Giordano wrote:This is a very old statement that you should never use anymore. Replace it with a LOCAL statement. Anyway, I just tested your sample with XIMAGE and found no difference between the results using IMAGE and XIMAGE. How to reproduce the problem?concentra wrote:Code: Select all | Expand
PARAMETER cFile
https://imgur.com/tpksOVk
Code: Select all | Expand
// C:\FWH\SAMPLES\CONCENT4.PRG
#Include "Fivewin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oImage, oXImage, cFile := "Image.tif", oSay, oSay2
DEFINE WINDOW oWnd FROM 1, 1 TO GetSysMetrics(1)-100, GetSysMetrics(0)-200 ;
TITLE "FiveWin Images" PIXEL
@ 1, 1 SAY oSay PROMPT "This a Test: IMAGE" OF oWnd SIZE 140, 12 UPDATE ;
COLOR CLR_RED TRANSPARENT ADJUST
@ 3, 1 IMAGE oImage SIZE ( oWnd:nWidth / 2 ) - 30, oWnd:nHeight - 90 ;
FILE cFile OF oWnd // ADJUST
oImage:nZoom := ( ( oWnd:nWidth / 2 ) - 30 ) / nBmpWidth( oImage:hBitmap )
oImage:lTransparent := .T.
@ 1, 69 SAY oSay2 PROMPT "This a Test: XIMAGE" OF oWnd SIZE 140, 12 UPDATE ;
COLOR CLR_RED TRANSPARENT ADJUST
@ 40, ( GetSysMetrics( 0 ) - 200 ) / 2 XIMAGE oXImage ;
SIZE ( oWnd:nWidth / 2 ) - 30, oWnd:nHeight - 90 ;
FILE cFile OF oWnd UPDATE // NOBORDER
oXImage:FitWidth()
oXImage:nUserControl := 0
oXImage:Shadow()
oXImage:lTransparent := .T.
ACTIVATE WINDOW oWnd CENTERED
oImage:End()
RETURN NIL
// FIN / END
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Image x xImage quality difference
I tested your sample and found no "white stains" on my result. Do you want to see a screenshot?
Re: Image x xImage quality difference
Yes please.Enrico Maria Giordano wrote:I tested your sample and found no "white stains" on my result. Do you want to see a screenshot?
Gracias, tks.
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- Enrico Maria Giordano
- Posts: 8728
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: