Memory problem with images

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hello everybody,
I'm developing a ppc application that receives images from a url and
periodically displays them in a picturebox (I use a timer control).

private sub tick(...) handles myTimer.tick
'pbx is the target picturebox control
pbx.image = getImage()
end sub

private function getImage() as bitmap
'strUrl is the stream containing the image
return new bitmap(strUrl)
end function

The problem is that at each ticking a new bitmap object is created
exhausting memory resources.
I'd like creating a bitmap object once and using a '.FromStream' method
at each ticking, but the Image.FromStream static method is not
evailable for the compact framework.

Any clue?

.



Relevant Pages

  • Re: need a thumbnail browser without memory limitations
    ... a single picturebox and detect the picturebox click events together with the ... But due to the large number of images you want to support, ... Private Sub Form_Paint ... Dim idx As Long, Y As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: PictureBox Troubles Update
    ... A small test app will show you if VB can handle your images. ... Picturebox to a new form and change the filename below to see what ... Private Sub Form_Load ...
    (microsoft.public.vb.general.discussion)
  • Re: How to do clickable image with overdraw and data storage
    ... For the PictureBox... ... want to work with colored circles instead of black ones). ... Shape control on the form and press Ctrl+X to Cut it into the Clipboard, ... Private Sub Command1_Click ...
    (comp.lang.basic.visual.misc)
  • Re: Computing for Outlook Express in VB.
    ... The VB Sendkeys function is designed for just such a purpose. ... the active window, at the rate of one per minute. ... containing a Timer Control and run the program. ... Private Sub Timer1_Timer ...
    (comp.lang.basic.visual.misc)
  • Re: Draw a line on Picture box
    ... > I have the following code for drawing a line on form......can any one ... > Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As ... The code should work fine in a PictureBox, but you need to move the code to ...
    (microsoft.public.vb.general.discussion)