473,320 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MouseDown, MouseUp, Timing and Threading

I'm working on an application that manages large image files (mulit-page
..Tiff's to be exact some 1000+ pages).

I've written an user control that displays a number of the images as
thumbnails in a scrollable window. The user can select and modify Images
from my thumbnail control. I need to let the user re-arrange the images if
they are out of order. I need the user to be able to click on a thumbnail or
multiple and DRAG them to the correct position, BUT I don't just want
erroneous clicking and barley moving the mouse to do the re-order. On Event
MouseDown I capture the selected image(s) in a array, then pop off a new
thread that waits 1 second before it sets a Bool that allows re-ordering,
and displays a blinky thing to show where the re-order is going to go. On
Event MouseMove I just change the position of the blinkything (if needed) to
reflect the position of where it's going to go. On Event MouseUp if the
timer has gone long enough (one second) and it's in a new position then I
re-order...

Here's my problem. When a user MousesDown, in another part of the app, a
full size-image gets loaded and displayed(only one page); now if I'm loading
a big 300dpi grayscale image, it takes over a second. So on these large
images, when a user MouseDowns, moves the mouse, and then MouseUps in under
the time it takes the large image to load, the MouseUp event doesn't happen
until it loads (which is over a second) so it assumes the user meant to move
no matter what, which really messes things up.

I'm writing this control to be used by others, and telling them to work
around this is unacceptable. Is there a way to have the MouseUp event
handled in separate Thread so that the large processing time doesn't break
my control? or some other ingenious way to do this? :) I understand that the
built-in Drag-Drop events also happen in the same thread so I'm pretty sure
that wouldn't help me, and I don't need to worry about stuff being dragged
into/out of my control.
Jul 21 '05 #1
1 1663
Hi Jeremy,

I'm not sure I fully understand what you are saying - the 'in another part
of the app, a
full size-image gets loaded' part - but I wonder whether it might be easier to
do the image loading in a different thread rather than trying to MouseUp in a
different thread?

Another curiousity - is this large-image loadingh part of your drag-n-drop
rearranging? If not, perhaps you could simply not allow a drag to be initiated
until the load has finshed?

Regards,
Fergus
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
1
by: Jeremy Robertson | last post by:
I'm working on an application that manages large image files (mulit-page ..Tiff's to be exact some 1000+ pages). I've written an user control that displays a number of the images as thumbnails...
1
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.