JPG to screen

JPG to screen

Postby patili » Sun Sep 21, 2008 9: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.
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby dutch » Sun Sep 21, 2008 10:08 am

Dear Patili,

I think it may help.

Code: Select all  Expand view  RUN
         
   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
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby patili » Wed Sep 24, 2008 7:23 pm

Sorry but i don't have "IMAGE" in my Fivewin??
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Antonio Linares » Thu Sep 25, 2008 12:48 am

Patrick,

What FW version are you using ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby patili » Thu Sep 25, 2008 8:03 pm

FW 2.1 and i don't see "image"
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Antonio Linares » Thu Sep 25, 2008 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42111
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby patili » Thu Sep 25, 2008 8:57 pm

Waou i've not explored all the source!!!
Thanks
Patrick (the last which isn't on harbour)
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby patili » Thu Sep 25, 2008 8:59 pm

Thank you Dutch i will use and abuse of your Prg
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 13 guests