FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour copy a portion of picture
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
copy a portion of picture
Posted: Sat Apr 25, 2009 01:27 PM

I f i have a picture on a window or dialog How I can take with the mouse a box ( dotted) and zoom it and print only that portion of that image ?

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: copy a portion of picture
Posted: Mon Apr 27, 2009 04:05 PM
Hello Silvio,

I think, a solution could be, to use sliders around the dialog with the image.
with that, You could define the Top-, Left-, Bottom-, Right-Position of the Imagepart.
The Slider-position will define the borders of the Image-area, You want to save.

In one of my new tools, I use this solution, to create Gradient-Images.
I can resize and save the new Image.
For this function, I only have to define Bottom- and Right-Position.



Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: copy a portion of picture
Posted: Mon Apr 27, 2009 04:39 PM
Uwe,
from Otto google sample :
Code (fw): Select all Collapse
 Function Mappa_google()

   local oDlg, oActiveX
   local cStreet := PadR( "SAN MARINO", 80 )
   local cCity := PadR( "TERAMO", 80 )
   local cCountry := PadR( "ITALY", 80 )
   DEFINE DIALOG oDlg RESOURCE "MAPPA"
   REDEFINE ACTIVEX oActiveX ID 100 OF oDlg PROGID "Shell.Explorer"
   REDEFINE GET cStreet ID 200 OF oDlg
   REDEFINE GET cCity ID 300 OF oDlg
   REDEFINE GET cCountry ID 400 OF oDlg
   REDEFINE BUTTON ID 1 OF oDlg ACTION Show( cStreet, cCity, cCountry, oActiveX )
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT Show( cStreet, cCity, cCountry, oActiveX )
return nil

function Show( cStreet, cCity, cCountry, oActiveX )
   local cHtml := MemoRead( ".\MAPPE\gmap.html" )
   cHtml = StrTran( cHtml, "<<STREET>>", AllTrim( cStreet ) )
   cHtml = StrTran( cHtml, "<<CITY>>", AllTrim( cCity ) )
   cHtml = StrTran( cHtml, "<<COUNTRY>>", AllTrim( cCountry ) )
   MemoWrit( "temp.html", cHtml )
   oActiveX:Do( "Navigate2", CurDrive() + ":\" + CurDir() + "\temp.html" )
return nil


I wanted save with the mouse a box of this image to print it
it is possible ?
Best Regards, Saludos



Falconi Silvio

Continue the discussion