Problem with bitblt

I have a form with PicBoxA in side FrameA and PicBoxB in PicBoxC and i am trying to copy PicBoxB to PicBoxA. but when i try vb gives me the error.
Can't create autoredraw image.
if i turn autoredraw off on PicBoxA and PicBoxB it works but i want autoredraw on.

Form setup
||                         Main Form                              ||
||  /-------------------------\            //===========\\   ||
||  |    FrameA          |            || PicBoxC         ||   ||
||  |   ****************  |            || ****************  ||   ||
||  |  * PicBoxA     *  |            || * PicBoxB    * ||   ||
||  |  *****************  |            || **************** ||   ||
||  \-------------------------/            \\===========//  ||
This probly wont look right but i hope you see what i mean.
I am trying to copy PicBoxB to PicBoxA

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What if you set AutoRedraw to false just before the BitBlt line? and then set AutoRedraw back to true when done..
If PicBoxB is contained in PicBoxC, try making PicBoxB's container the form, then position it over PicBoxC.

The only reference to this error (480) that I could find from MS relates only to VB3 and VB4.
This error may also be the result of low system memory.  By setting the autoredraw property true, the system makes a memory image of the object's surface. If you have large images, or a lot of images, your memory resources will be depleted.

Try closing unneeded applications before you run the program.  Also try compiling into an EXE and run the program with VB closed.

This is a trappable error, so you can use On Error to trap it before the program crashes.  This way, the user knows there is not enough memory. (If this is really the problem).
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

centaursAuthor Commented:
Thanks every one ill try some of these ideas shortly.
both images are very big so there is a good chance that that is the problem.
and i cant just put it over it because it needs to be scrolable because both Pic A & B about 16000 pixels wide and high. I guess i just make it smaller and  hopefuly it will work other wise ill try VBMasters idea.
centaursAuthor Commented:
Erick 37 it worked now if you want your points just answer the question.
If you have preloaded a picture into the PictureBox's .Picture property, you can clear the image when you are done with blitting by calling
Picture1.Picture = LoadPicture("").
This will also free some memory resources.

Also, if you turn off the Autoredraw property, you can use the PictureBox's Paint event to keep the image refreshed.  This will prevent the second image from having to be stored in memory:


Private Sub Picture1_Paint()
    BitBlt Picture1.hDC, 0, 0, 300, 300, _
           Picture2.hDC, 0, 0, vbSrcCopy
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
centaursAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.