FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper JPG to screen
Posts: 98
Joined: Mon Jan 23, 2006 09:34 AM
JPG to screen
Posted: Sun Sep 21, 2008 09:07 AM

Hi everybody
How can i show a jpg picture on the screen in a dialog winfow?
Without converting it to bmp.
And with an auto-adaptation (i am not sure from my english) of the size.
I need to show some echography picture in the form of my patient.

Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
JPG to screen
Posted: Sun Sep 21, 2008 10:08 AM
Dear Patili,

I think it may help.

         
   REDEFINE IMAGE oImg ID 11 OF oDlg SCROLL

         oImg:Progress( .F. )

   REDEFINE SBUTTON oBtn[1] ID 12 ;
            PROMPT TE('ร ยตรงรยกรƒรยบ','Stretch') ;
            WHEN lGstPhoto ;
            ACTION AjustaZoom( oImg ,"S" ) ;
            COLOR {|oBtn| If( oBtn:lMouseOver, CLR_YELLOW, CLR_BLACK ) } ;
            NOBORDER ;
            TEXT ON_BOTTOM

   REDEFINE SBUTTON oBtn[2] ID 13 ;
            PROMPT TE('ยขร‚ร’ร‚','Zoom In') ;
            WHEN lGstPhoto ;
            ACTION AjustaZoom( oImg ,"A" ) ;
            COLOR {|oBtn| If( oBtn:lMouseOver, CLR_YELLOW, CLR_BLACK ) } ;
            NOBORDER ;
            TEXT ON_BOTTOM

   REDEFINE SBUTTON oBtn[3] ID 14 ;
            PROMPT TE('ร‚รจร','Zoom Out') ;
            WHEN lGstPhoto ;
            ACTION AjustaZoom( oImg ,"R" ) ;
            COLOR {|oBtn| If( oBtn:lMouseOver, CLR_YELLOW, CLR_BLACK ) } ;
            NOBORDER ;
            TEXT ON_BOTTOM

*------------------------------------*
Function AjustaZoom(oBmp,cAccion)
local nZoom:=oBmp:Zoom()

do case
   case cAccion == "S"
        oBmp:lStretch := !oBmp:lStretch
        oBmp:ScrollAdjust()
        oBmp:Refresh( .T. )
   case cAccion == "R"
        if nZoom*10>=1
           oBmp:lStretch := .F.
           nZoom:=nZoom-(0.10)
           oBmp:Zoom(nZoom)
           oBmp:Refresh()
           oBmp:ScrollAdjust()
        endif
   case cAccion == "A"
        oBmp:lStretch := .F.
        nZoom:=nZoom+0.10
        oBmp:Zoom(nZoom)
        oBmp:Refresh()
        oBmp:ScrollAdjust()
endcase

return NIL
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 98
Joined: Mon Jan 23, 2006 09:34 AM
JPG to screen
Posted: Wed Sep 24, 2008 07:23 PM

Sorry but i don't have "IMAGE" in my Fivewin??

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
JPG to screen
Posted: Thu Sep 25, 2008 12:48 AM

Patrick,

What FW version are you using ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 98
Joined: Mon Jan 23, 2006 09:34 AM
JPG to screen
Posted: Thu Sep 25, 2008 08:03 PM

FW 2.1 and i don't see "image"

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
JPG to screen
Posted: Thu Sep 25, 2008 08:41 PM

Patrick,

Please look for source\classes\image.prg

The first version of Class TImage was added in FW 2.0

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 98
Joined: Mon Jan 23, 2006 09:34 AM
JPG to screen
Posted: Thu Sep 25, 2008 08:57 PM

Waou i've not explored all the source!!!
Thanks
Patrick (the last which isn't on harbour)

Posts: 98
Joined: Mon Jan 23, 2006 09:34 AM
JPG to screen
Posted: Thu Sep 25, 2008 08:59 PM

Thank you Dutch i will use and abuse of your Prg

Continue the discussion