Thanks for the link Lucean, I'll check it out.
"Lucean Morningside" <m@exquisitor.com> wrote in message
news:223a495.0307192227.6fdb459d@posting.google.co m...[color=blue]
> "Alien" <alien@sympatico.ca> wrote in message[/color]
news:<GkkSa.6265$PJF1.4991@news01.bloor.is.net.cab le.rogers.com>...[color=blue][color=green]
> > I have a hex editor-type class that extends UserControl and paints its[/color][/color]
data[color=blue][color=green]
> > to a PictureBox. Basically the problem is that repainting it takes[/color][/color]
usually[color=blue][color=green]
> > between 60 and 80ms, which may seem pretty fast but is not good enough[/color][/color]
when[color=blue][color=green]
> > you have to repaint very frequently. For example, when you scroll the
> > control or select blocks of text quickly.
> >
> > I have it paint its graphics to an offscreen Graphics instance, which I[/color][/color]
then[color=blue][color=green]
> > transfer to the PictureBox using g.DrawImage(Image m, int x, int y)...
> > Making it paint directly onto the PictureBox is (understandably) even
> > slower.
> >
> > So, is there anything I can do to improve the situation or am I stuck?[/color][/color]
I'm[color=blue][color=green]
> > on a 1.4ghz Athlon by the way.
> >
> >
> > Thanks[/color]
>
> There's only one thing that you can do: profile your code to find all
> performance bottlenecks. I ran into a similar performance problem once[/color]
when[color=blue]
> I was writing a fractal image compression and decompression program. I[/color]
tried[color=blue]
> to blindly optimize the code, but I never got any real performance[/color]
increase. Not[color=blue]
> until I ran my code through a profiler. Only then was I able to locate the[/color]
exact[color=blue]
> methods that needed optimization. You can use Compuware's DevPartner[/color]
Profiler[color=blue]
> Community Edition, which can be found at:
>
http://www.compuware.com/products/de...er/default.asp
>
> Hope this helps.
>
> -LM[/color]