Re: PPC flicker problem.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I solve it out.

and then I delete the OnPaintBackground(PaintEventArgs paintg).
It doesn't affect the appearence.

So, this method is just useful in some condition.

pengjetty wrote:
protected override void OnPaintBackground(PaintEventArgs paintg)
{
// Left empty, avoids undesirable flickering
}

Like this?
I have done that, but it doesn't make any difference.

<ctacke/> wrote:
Override the OnPaintBackground and have it do nothing.

-Chris


<pengjetty@xxxxxxxxx> wrote in message
news:1148977284.219611.18040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
There is a picture(512*512) in the panel(300*200), when I move the
mouse, the picture in the panel should also move following the mouse...

But here comes the problem, when I deploy this program on the HP2790
and drag the picture, the screen is flicker.

I use the Bitblt, but it doesn't work.

Does anyone can solve it? Any advice is helpful.Thank you.

Here is my code(the event handle of mousemove and the paint handle of
the panel):

private void panelMap_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (mouseIsDown == true)
{
this.presentPoint.X = this.lastPoint.X + (e.X -
this.downPoint.X) * 2;
this.presentPoint.Y = this.lastPoint.Y + (e.Y -
this.downPoint.Y) * 2;
this.panelMap.Refresh();
}
}

// Bitblt in C#
private void panelMap_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Graphics g;

if (this.bufferMap == null)
{
this.bufferMap = new Bitmap(this.panelMap.Width,
this.panelMap.Height);
}

g = Graphics.FromImage(this.bufferMap);

g.DrawImage(this.imgMap, this.presentPoint.X, this.presentPoint.Y);

e.Graphics.DrawImage(this.bufferMap, 0, 0);
}


.



Relevant Pages

  • Simple? Form Design Question
    ... the visiblechanged property of a particular panel. ... private void toolStripButton1_Click(object sender, EventArgs ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: multiple panels mouse movements similar functiionality but different datasets.
    ... private void panel2_MouseDown... ... that sub-class wherever you want a panel that behaves in that way. ... then retrieving that data in the event handler (by casting the "sender" ...
    (microsoft.public.dotnet.languages.csharp)
  • Cant update foreground panel from background thread
    ... But can't get the panel to show the new controls ... click on "button1" a backgroundworker thread in async mode is started. ... private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Cant update foreground panel from background thread
    ... I'm still having problems updating my UI panel. ... I need to populate the controls I ... private void UpdatePanel ... private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Threading problem
    ... Alvin Bruney ... private void goToolStripMenuItem_Click(object sender, EventArgs ... private void drawBitmap(BackgroundWorker worker, DoWorkEventArgs ... BackgroundWorker worker = sender as BackgroundWorker; ...
    (microsoft.public.dotnet.framework)