|
-
Jan 8th, 2002, 01:47 AM
#1
Thread Starter
Addicted Member
clearing a picture box area
is there any API / method to clear a particular area of a picture box .. I have the start and end co-ordinate and i want to clear that particular area of a picture . i think some API like sendmessage can do it by taking pictrue box handle.Write now i m using another pic box and placing it above that area to clear that area but it is causing some problem for other operation ..
is there any way to do it by coding ??
thanks in advance ..
-
Jan 8th, 2002, 07:19 AM
#2
I'm not sure that you would necessarily need to use an API call. I think using the Pictures build in Line property and its Backcolor might do the trick for you.
-
Jan 8th, 2002, 08:46 AM
#3
Thread Starter
Addicted Member
ya i got .. i think showing a fill rectangle will do ..
-
Jan 8th, 2002, 10:28 AM
#4
When you get it all worked out, why don't you post the code your wrote here. It might help someone else.
-
Jan 8th, 2002, 07:30 PM
#5
But, Picture1.Cls would clear everything. I think chander only wants to clear a certain portion of the Picture box. Is that correct, chander, or no?
-
Jan 8th, 2002, 08:24 PM
#6
PowerPoster
Hi Hack
The qtn was posted twice and already answered in the General forum.
VB Code:
Private Sub Command1_Click()
'x1,y1 to x2, y2, req'd colour, B for box and F for fill
Picture1.Line (0, 0)-(500, 500), Picture1.BackColor, BF
End Sub
http://www.vbforums.com/showthread.p...hreadid=132356
Regards
Stuart
-
Jan 9th, 2002, 12:56 AM
#7
Thread Starter
Addicted Member
ya hack its right i asked for clearing a portion only and it is best with rectangle . The code is same as beachbum wrote just instead of x,y and x1,y1 u can give ur own co-ordinates . My code use a Shape rectangle and when mouse is up its co-ordinates are trapped and rectable is made by same code as beachbum wrote.
In mouse down of pic
tX = x
tY = y
in mouse up
picMain.Line (tX, tY)-(tX + w, tY + h), ForeCol, B
where w and h are width and height calculated from size of rectangle and it forms the ending co-ordinates . thats it .. or u can take x1,y1 in mouse up and draw . Use forecolor and fill color white so that portion can be seen as clear.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|