Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Picturebox: repainting only a certain area

Posted on 2001-06-22
4
Medium Priority
?
485 Views
Last Modified: 2008-03-17
Hi,

Can anyone tell me how i can redraw/repaint only a certain area of a picturebox? thanks.
0
Comment
Question by:3Mann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Microsoft
ID: 6217388
0
 
LVL 2

Expert Comment

by:Microsoft
ID: 6217398
Syntax 1
public void repaint()
Description
Repaints this component.
This method causes a call to this component's update method as soon as possible.


See Also
update





Syntax 2
public void repaint( long tm )
Parameters
tm
maximum time in milliseconds before update
Description
Repaints the component. This will result in a call to update within tm milliseconds.

See Also
paint, update





Syntax 3
this explains how to use repaint
0
 
LVL 3

Accepted Solution

by:
RodStephens earned 200 total points
ID: 6218201
If you keep an image of the surface somewhere like a hidden PictureBox, you could use PaintPicture to refresh the area you want.

Or you could use the API to set a clipping region to include the area you want to refresh. Then if you redraw everything, only the part in the clipping area gets drawn. Depending on the picture, this may be slightly faster than redrawing everything. (PaintPicture will be much faster).

However, in any case you will need some way to know what area to refresh and VB doesn't normally provide that.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6219198
If you have a specific image that you want on a portion of the picture, you can simply place the image into a frameless ImageBox and it will appear to be in the PictureBox.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question