Bug with PictureBox 
Author Message
 Bug with PictureBox

I don't know if this is a bug, created a little App with
a picturebox control and a timer, each time the timer
fires it's only event the app randomizes a number, after
getting that number, builds the path where i have some
jpg's pictures, and the loads a picture according to the
number the app gets.
The bug (I think) is, after loading the image, the app
uses 1.2 Mb of RAM added to the 13.7 Mb that already
used, again, the app fires the timer event and the
picturebox image property is set to nothing, but this
doesnt relases the memory used, and when the new picture
is loaded the app uses 1.2 Mb more of memory, if this
goes on and on the app uses too much memory, if you want

Please let me know if this a bug, or this is the way it
is supposed to work


Mon, 23 Aug 2004 07:56:47 GMT  
 Bug with PictureBox
It's probably a bug, but with your code rather than the PictureBox (or VB).

Instead of setting the Image property to Nothing, try the following instead:

Picture1.Picture = LoadPicture()

Mike


I don't know if this is a bug, created a little App with
a picturebox control and a timer, each time the timer
fires it's only event the app randomizes a number, after
getting that number, builds the path where i have some
jpg's pictures, and the loads a picture according to the
number the app gets.
The bug (I think) is, after loading the image, the app
uses 1.2 Mb of RAM added to the 13.7 Mb that already
used, again, the app fires the timer event and the
picturebox image property is set to nothing, but this
doesnt relases the memory used, and when the new picture
is loaded the app uses 1.2 Mb more of memory, if this
goes on and on the app uses too much memory, if you want

Please let me know if this a bug, or this is the way it
is supposed to work



Mon, 23 Aug 2004 21:17:00 GMT  
 Bug with PictureBox
It is indeed a bug.  You haven't said which version of VB you are using, nor
which service pack.  Nor do I know which of those exhibits this bug or
whether any version is free of it.  You can easily work around it in your
case, though, because the bug is when you set the image property to nothing.
There is no reason to do that in this case.  Just load the next picture and
I believe your problem will be over.

IIRC, memory leaks (in some versions/service packs) when you do
Picture1.cls       or
Set Picture1.Picture = Nothing
but not if you do
Picture1.Line (0, 0) - Step(Picture1.ScaleWidth, Picture1.ScaleHeight),
Picture1.BackColor, BF

Jim Deutch
MS Dev MVP


I don't know if this is a bug, created a little App with
a picturebox control and a timer, each time the timer
fires it's only event the app randomizes a number, after
getting that number, builds the path where i have some
jpg's pictures, and the loads a picture according to the
number the app gets.
The bug (I think) is, after loading the image, the app
uses 1.2 Mb of RAM added to the 13.7 Mb that already
used, again, the app fires the timer event and the
picturebox image property is set to nothing, but this
doesnt relases the memory used, and when the new picture
is loaded the app uses 1.2 Mb more of memory, if this
goes on and on the app uses too much memory, if you want

Please let me know if this a bug, or this is the way it
is supposed to work



Tue, 24 Aug 2004 01:07:10 GMT  
 Bug with PictureBox
Yes, I forgot the version... sorry
I'm using Visual Basic .NET
RSV

Quote:
>-----Original Message-----
>It is indeed a bug.  You haven't said which version of

VB you are using, nor
Quote:
>which service pack.  Nor do I know which of those

exhibits this bug or
Quote:
>whether any version is free of it.  You can easily work
around it in your
>case, though, because the bug is when you set the image

property to nothing.
Quote:
>There is no reason to do that in this case.  Just load

the next picture and
Quote:
>I believe your problem will be over.

>IIRC, memory leaks (in some versions/service packs) when
you do
>Picture1.cls       or
>Set Picture1.Picture = Nothing
>but not if you do
>Picture1.Line (0, 0) - Step(Picture1.ScaleWidth,

Picture1.ScaleHeight),
Quote:
>Picture1.BackColor, BF

>Jim Deutch
>MS Dev MVP


message

>I don't know if this is a bug, created a little App with
>a picturebox control and a timer, each time the timer
>fires it's only event the app randomizes a number, after
>getting that number, builds the path where i have some
>jpg's pictures, and the loads a picture according to the
>number the app gets.
>The bug (I think) is, after loading the image, the app
>uses 1.2 Mb of RAM added to the 13.7 Mb that already
>used, again, the app fires the timer event and the
>picturebox image property is set to nothing, but this
>doesnt relases the memory used, and when the new picture
>is loaded the app uses 1.2 Mb more of memory, if this
>goes on and on the app uses too much memory, if you want

>Please let me know if this a bug, or this is the way it
>is supposed to work

>.



Wed, 25 Aug 2004 00:12:31 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Is this a bug with picturebox control?

2. picturebox or image control bug, HELP

3. Bug: drawing/resizing a PictureBox eat up GDI Resources on Win95

4. Bug in hPal property of PictureBox?

5. Viewport, BitBlt and PictureBox.Bug ??

6. Is there a eVB PictureBox.Drawmode bug?

7. IDE BUGs, BUGs, BUGs....

8. BUGS BUGS BUGS!

9. Project98 OLE & VB: bugs, bugs, bugs

10. Help!! Loading PictureBox FromStream and PictureBox.Image.Save

11. Best way to preview a font in a PictureBox (WAS: Question on Picturebox or an alternative)

12. copying a modified picturebox into a new picturebox

 

 
Powered by phpBB® Forum Software