Displaying a DIB

Displaying a DIB

Post by Perc » Sun, 07 Apr 2002 00:20:23



Hi there,
Im receiving data from a camera via USB2.0 and displaying
line by line on the screen. For that, Im using a DIB and
everything is working fine. The problem is that when I
move the mouse, the image becomes partially distorted, I
mean, from a certain line on, randonly, the image distort.
What could possibly be happening? Is there any way to
solve it?
Thanks.
 
 
 

Displaying a DIB

Post by Mike D Sutto » Sun, 07 Apr 2002 07:09:38


Quote:>Im receiving data from a camera via USB2.0 and displaying
>line by line on the screen. For that, Im using a DIB and
>everything is working fine. The problem is that when I
>move the mouse, the image becomes partially distorted, I
>mean, from a certain line on, randonly, the image distort.
>What could possibly be happening? Is there any way to
>solve it?

Is the image data compressed?  I've had the same problem with RLE compressed
bitmap's before, normally with packed DIB's you don't get these kinds of
artefacts, only skewing for odd scan-lines.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/



 
 
 

Displaying a DIB

Post by John Chewte » Mon, 08 Apr 2002 20:28:45


@Mike

Packed dib in memory - I saw your good stuff on your website re avi's etc
but was unable to  anything with packed dibs in memory  - I did searches for
more info without success.

If I have the handle of a dib in ram - how do I get that to avi? No what I
try I just get errors.



> >Im receiving data from a camera via USB2.0 and displaying
> >line by line on the screen. For that, Im using a DIB and
> >everything is working fine. The problem is that when I
> >move the mouse, the image becomes partially distorted, I
> >mean, from a certain line on, randonly, the image distort.
> >What could possibly be happening? Is there any way to
> >solve it?

> Is the image data compressed?  I've had the same problem with RLE
compressed
> bitmap's before, normally with packed DIB's you don't get these kinds of
> artefacts, only skewing for odd scan-lines.
> Hope this helps,

>     Mike

>  -- EDais --

>  - Microsoft Visual Basic MVP -
> WWW: Http://EDais.earlsoft.co.uk/



 
 
 

Displaying a DIB

Post by Mike D Sutto » Mon, 08 Apr 2002 23:06:36


Quote:> Packed dib in memory - I saw your good stuff on your website re avi's etc
> but was unable to  anything with packed dibs in memory  - I did searches
for
> more info without success.

> If I have the handle of a dib in ram - how do I get that to avi? No what I
> try I just get errors.

www.ShrinkwrapVB.com will have your answer, I believe Ray Mercer even
created a "CreateFromPackedDIBPointer()" method in his implementation of a
DIB class specifically for this.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/


 
 
 

Displaying a DIB

Post by Perc » Thu, 11 Apr 2002 02:25:33


Thanks for your help, Mike. Here goes some more
information:
I make a StretchDIBblt. So the image is adjusted to "fit"
in the frame. I think that the PC spend time dealing with
the mouse interruption and someway I have my image
distorted. Is there any way to disable the mouse during
displaying the image?
Thanks,
>-----Original Message-----
>>Im receiving data from a camera via USB2.0 and
displaying
>>line by line on the screen. For that, Im using a DIB and
>>everything is working fine. The problem is that when I
>>move the mouse, the image becomes partially distorted, I
>>mean, from a certain line on, randonly, the image
distort.
>>What could possibly be happening? Is there any way to
>>solve it?

>Is the image data compressed?  I've had the same problem
with RLE compressed
>bitmap's before, normally with packed DIB's you don't get
these kinds of
>artefacts, only skewing for odd scan-lines.
>Hope this helps,

>    Mike

> -- EDais --

> - Microsoft Visual Basic MVP -
>WWW: Http://EDais.earlsoft.co.uk/


>.

 
 
 

Displaying a DIB

Post by Mike D Sutto » Thu, 11 Apr 2002 04:07:59


Thanks for your help, Mike. Here goes some more
information:
I make a StretchDIBblt. So the image is adjusted to "fit"
in the frame. I think that the PC spend time dealing with
the mouse interruption and someway I have my image
distorted. Is there any way to disable the mouse during
displaying the image?

I doubt the mouse moving would do anything, but you could try using the
ClipCursor() API and bind the cursor to it's existing position (You can find
that with GetCursorPos())
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/


 
 
 

Displaying a DIB

Post by Perc » Thu, 11 Apr 2002 06:04:21


Thanks, Mike.
It seems to be working much better! I clipped the mouse in
a very tiny region and the distortion stopped.

Quote:>-----Original Message-----
>Thanks for your help, Mike. Here goes some more
>information:
>I make a StretchDIBblt. So the image is adjusted to "fit"
>in the frame. I think that the PC spend time dealing with
>the mouse interruption and someway I have my image
>distorted. Is there any way to disable the mouse during
>displaying the image?

>I doubt the mouse moving would do anything, but you could
try using the
>ClipCursor() API and bind the cursor to it's existing

position (You can find
>that with GetCursorPos())
>Hope this helps,

>    Mike

> -- EDais --

> - Microsoft Visual Basic MVP -
>WWW: Http://EDais.earlsoft.co.uk/


>.

 
 
 

Displaying a DIB

Post by Mike D Sutto » Thu, 11 Apr 2002 07:15:00


Quote:> It seems to be working much better! I clipped the mouse in
> a very tiny region and the distortion stopped.

Since this is "Depreciated" behaviour, it would probably be best to hide the
cursor too using the ShowCursor() API.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/


 
 
 

Displaying a DIB

Post by Perc » Fri, 12 Apr 2002 01:58:43


Thanks, Mike.
That is exactly what I wanted. Great!

Percy.

>-----Original Message-----
>> It seems to be working much better! I clipped the mouse
in
>> a very tiny region and the distortion stopped.

>Since this is "Depreciated" behaviour, it would probably
be best to hide the
>cursor too using the ShowCursor() API.
>Hope this helps,

>    Mike

> -- EDais --

> - Microsoft Visual Basic MVP -
>WWW: Http://EDais.earlsoft.co.uk/


>.