A Box in PicBox

Thread Solved
Reply

Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

A Box in PicBox

 
1
  #1
Sep 8th, 2006
erm greetings..

i have a situation here regarding picturebox. there are 2 boxes, 1 is for template image, and one for image to be compared with. i planned to make the user able to draw a box in template image picbox, as a region where the image the other picbox will be compared with, in terms of its colour components. it will display the difference between the two images in percentage.

the problem is making the box visible when doing the region selection part. i cant seem to properly generate temporary marking lines on the template image. all i get in the end is an array of boxes in different size within a maximum size box, which all of the boxes start at the point of the click.

i can however, make a box at the end of the click and drag procedure, but that doesnt give any visual feedback during the region selection process, which is the clicking and dragging. the box is not there, until you release the mouse button, that makes it hard for the user.

i used the usual

TempBox.DrawWidth=1
Tempbox.DrawLine (x,y)

to draw lines between initial clicking points and other points.

any suggestions would be greatly appreciated.

thanks in advance
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: A Box in PicBox

 
1
  #2
Sep 8th, 2006
why can't you do it on mouse_move? On mousedown set a boolean flag variable that says that the mouse is down. On mouseup clear the boolean flag variable (set it to false). On the mousemove procedure, check if the flag variable is true, and if so, draw the line..... if the flag variable is false, don't draw the line.... or am I completely missing the mark here?
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: A Box in PicBox

 
0
  #3
Sep 11th, 2006
Not entirely. Before this I did it in mousemove with a flag, that's when the array of boxes appear. Small boxes inside bigger boxes. What i'm trying to do here is a region selection box, which defines the border of the region in the image I'm going to compare with another. Is there any specific function that can be readily used?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: A Box in PicBox

 
0
  #4
Sep 11th, 2006
Nothing that is readily, so to speak. You may have a look at bitblt or stretchblt to copy pieces of the image, but as for the whole region selection issue, I have no pre-defined method. Good luck, let me know what you find.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: A Box in PicBox

 
0
  #5
Sep 11th, 2006
it's ok i found the solution, that is shpcrop, a crop box. never knew such thing existed.

thanks for your time.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: A Box in PicBox

 
0
  #6
Sep 11th, 2006
Cool! Thanks for posting the solution.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC