CUT AN IMAGE

CUT AN IMAGE

Postby MdaSolution » Sun Jan 23, 2011 2:17 pm

IS THERE A SAMPLE TO SELECT A P ART OF AN IMAGE WITH MOUSE AND SAVE IT ?
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: CUT AN IMAGE

Postby ukoenig » Sun Jan 23, 2011 4: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.
Image

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

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 :
Image

Result with NO Border :
Image

Best regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: CUT AN IMAGE

Postby joseluisysturiz » Mon Jan 31, 2011 4:50 am

Excelente...!
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 89 guests