User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 392,075 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,118 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 1320 | Replies: 5 | Solved
Reply
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

A Box in PicBox

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: A Box in PicBox

  #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  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: A Box in PicBox

  #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  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: A Box in PicBox

  #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  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: A Box in PicBox

  #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  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: A Box in PicBox

  #6  
Sep 11th, 2006
Cool! Thanks for posting the solution.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 12:12 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC