Re: how to solve this OnPaint problem ? ( about remote screen transmit )

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

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 04/11/04


Date: Sun, 11 Apr 2004 20:36:43 +0100


微软新闻组 <fpe2000@163.net> wrote:
> i want to abtain remote screen capture on the pc in LAN.
> i was suggested to transmit the changed parts only to save the bandwidth.
> so i divide the screen into 10*10 parts. and now , i need to display the
> remote screen on my own form. my method is use this:
>
> Graphics c = this.createGraphics();
> c.drawImage(imageparts,xcoodinary,ycoodinary);// imageparts is ONE part
> // of the screen (1/100)
>
> whenever i receive a imageparts, i use the code above to draw the changed
> screen parts on a FORM. the code seems to work well.In the first time,i
> should call this code 100 times to get the original screen.after then , i
> could only call this code several times.
>
> but now ,when the FORM is changed or covered by other windows , with the
> repaint result ,the image disappeared or changed into a wrong display.
>
> So i should put the code above into OnPaint method. but the code above only
> redraws the changed parts of the remote screen, the others disappeared.
>
> How can i redraw the previous unchanged image already on the FORM ? OR are
> there other methods to solve this problem ?

You'll need to store all of the 100 parts in memory, and redraw
whichever bits of the screen are being repainted.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: Need Help Fixing GDI Leaks
    ... > presents data from one of the machines. ... > instigating a need to redraw the view every second. ... You are still breaking Rule 1 of Windows painting. ... your view would not properly repaint when uncovered. ...
    (microsoft.public.vc.mfc)
  • Re: Need Help Fixing GDI Leaks
    ... > presents data from one of the machines. ... > instigating a need to redraw the view every second. ... You are still breaking Rule 1 of Windows painting. ... your view would not properly repaint when uncovered. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Need Help Fixing GDI Leaks
    ... > presents data from one of the machines. ... > instigating a need to redraw the view every second. ... You are still breaking Rule 1 of Windows painting. ... your view would not properly repaint when uncovered. ...
    (microsoft.public.vc.mfc.docview)
  • Re: Complete repaint of everything
    ... I'm not at all familiar with AWT and can really only address Swing. ... repaint everything if it contains multiple top-level windows (i.e., ... It essentially schedules an event to redraw items in the ... Steve W. Jackson ...
    (comp.lang.java.gui)