Solution for autoredraw image

rajabadsha
04-20-2006, 11:51 AM
I found the following solution for autoredraw image in the MSDN library but don't exactly know how to implement.

Error: Can't create AutoRedraw image (Error 480)
Specifics

Visual Basic can't create a persistent bitmap for automatic redraw of the form or picture. This error has the following cause and solution:

There isn't enough available memory for the AutoRedraw property to be set to True. Set the AutoRedraw property to False and perform your own redraw in the Paint event procedure, or make the PictureBox control or Form object smaller and try the operation again with AutoRedraw set to True.

Can anyone give me some guide in how to perform redraw in the Paint event procedure?

Also is it please possible to drop this "Centurion" thing off my name. I even don't know the "V" of Visual Basic and struggling with simple stuffs let alone to become a "Centurion".

NFITC1
04-20-2006, 12:21 PM
I found the following solution for autoredraw image in the MSDN library but don't exactly know how to implement.

Error: Can't create AutoRedraw image (Error 480)
Specifics

Visual Basic can't create a persistent bitmap for automatic redraw of the form or picture. This error has the following cause and solution:

There isn't enough available memory for the AutoRedraw property to be set to True. Set the AutoRedraw property to False and perform your own redraw in the Paint event procedure, or make the PictureBox control or Form object smaller and try the operation again with AutoRedraw set to True.

Can anyone give me some guide in how to perform redraw in the Paint event procedure?

Also is it please possible to drop this "Centurion" thing off my name. I even don't know the "V" of Visual Basic and struggling with simple stuffs let alone to become a "Centurion".


I assume that you're running out of memory due to all the redraws. With AutoRedraw turned on your picture box is going to try to redraw after every graphic-based command you give it. Like drawing a circle or a line. If you set it to false, you should do the calculations then give it the command PictureBox1.Refresh and I think that'll solve the problem.
Is it safe to assume that this is happening at runtime?

rajabadsha
04-20-2006, 12:42 PM
Yes the problem is happening at runtime

rajabadsha
04-20-2006, 12:47 PM
I tried the Refresh but it did not work. The problem is occuring when I am using the following lines to draw a rectangle:

Private Sub DrawShape()

Picture1.Line (m_X1, m_Y1)-(m_X2, m_Y2), , B

End Sub

Cerian Knight
04-20-2006, 02:45 PM
What are the values of the m_X1, m_Y1, m_X2, m_Y2, Picture1.Width, .Height, .ScaleMode, .ScaleWidth and .ScaleHeight when the error is thrown? This should give a clue to the solution.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum