FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CUT AN IMAGE
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
CUT AN IMAGE
Posted: Sun Jan 23, 2011 02:17 PM

IS THERE A SAMPLE TO SELECT A P ART OF AN IMAGE WITH MOUSE AND SAVE IT ?

FWH .. BC582.. xharbour
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: CUT AN IMAGE
Posted: Sun Jan 23, 2011 04:11 PM
Hello,

with RAO's MDI-child transparent-sample and some small changes, it is possible to do this.
Once again, Thanks a lot to Mr.Rao, my tests are working perfect and it shows, how to use some Solutions
a different Way.

A MDI-frame with the selected Image-background.


Capturing a Part of the Main-background with Border and placing / resizing a transparent Mdi-Child to the desired position.


In case You don't want a Border, it is a bit more complicated :
You must define 2 Childs :
a NON visible < oWndChild > with
NOSYSMENU
NOICONIZE
BORDER NONE
NOCAPTION

A second < oWndSelect > For painting
NOSYSMENU
NOICONIZE

You define the MDI-child < oWndSelect > and move it to the Screenposition, You want to capture ( resize ).
The Button < Capture > saves the Coordinates and closes the Child < oWndSelect >.
Next the hidden Child < oWndChild > with the Position of the Child < oWndSelect > is created.
Next oWndChild:SaveToBmp( "Capture.BMP" ) is used.

1. Saving the Coordinates of < oWndSelect >
2. closing < oWndSelect >
3. creating < oWndChild > with the Coordinates of < oWndSelect >
4. Saving the Image-Area of < oWndChild >

DEFINE BUTTON OF oBar PROMPT "Capture-Child" ;
ACTION ( nTop := oWndSelect:nTop + 20, nLeft := oWndSelect:nLeft + 5, ;
nBottom := oWndSelect:nBottom - 5, nRight := oWndSelect:nRight -5, ;
oWndSelect:End(), TranspChild(), ;
oWndChild:SaveToBmp( "Capture.BMP"
) )

Capture Area with NO Border :


Result with NO Border :


Best 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: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: CUT AN IMAGE
Posted: Mon Jan 31, 2011 04:50 AM

Excelente...!

Dios no está muerto...



Gracias a mi Dios ante todo!

Continue the discussion