Cor,
If I putt a loop like this, will it not cause a single thread execution? I
mean this processor will get in this loop and not process the other event
which has to set the flag. Wouldn't this cause a infinite loop?.. The reason
I am saying this, I actually tried something like this.. and ended up in a
infinite loop...
I will actually explain my problem in more detail..
I have this Ink Picture control resize event, where I have to scale this ink
displayed, when the window or the control size changes. The resize code
works perfectly, expect when one of theses flags (InSendMessage, inkPicture
is Nothing, InkPicture.IsCollecting) is true. What happens here is my if one
of my IF condition fails..(see code below).. I don't get the original height
and width set at that time plus the scaling does not happen. This screws up
the scaling factor.. and hence the current scaling and any scaling happening
after that is messed up.. Also, the resize never gets called after this.
This the reason I am asking is there a way out to wait till these flags are
set by windows and then do my resize.
If Not InSendMessage() Then 'InSendMessage is a WindowsAPI used to
detect if the COM Interop process is busy, this check is need during
rotation of the screen.
If orgWidth > 0 And orgHeight > 0 Then
If Single.Parse(inkPicture1.Width.ToString) > 0 And
Single.Parse(inkPicture1.Height.ToString) > 0 Then
If Not inkPicture1 Is Nothing Then 'The Picture control
actually gets disposed when screen is in Rotation, so check for it
If Not inkPicture1.CollectingInk Then '3/5 times the
inkPicture is busy collecting Ink, so resize can't happen here..Mostly
during screen rotate.
inkPicture1.Renderer.Scale(Single.Parse(inkPicture1.Width.ToString) /
orgWidth, Single.Parse(inkPicture1.Height.ToString) / orgHeight, False)
orgHeight =
Single.Parse(inkPicture1.Height.ToString)
orgWidth = Single.Parse(inkPicture1.Width.ToString)
End If
End If
End If
End If
End If
I am going to copy this to the Tablet PC newsgroup. I am really surprised
nobody has every faced this ink scaling/display resize problem, or maybe I
am doing something worng..
Thanks for the help...
VJ