473,657 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.createGrap hics();
c.drawImage(ima geparts,xcoodin ary,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 ?

THX!

Nov 16 '05 #1
2 2922
I found this a little while ago and haven't used anything else since. I'm
pretty sure this is what vb6 used for autoredraw but since you control the
refresh it can be a lot faster.

pictureBox1.Ima ge = new Bitmap(pictureB ox1.Width, pictureBox1.Hei ght);
Image img = pictureBox1.Ima ge;
Graphics g = Graphics.FromIm age(img);
g.drawImage(ima geparts,xcoodin ary,ycoodinary) ;
pictureBox1.Ima ge = img;

You can play around with that if you need, but that's the meat of it.

Nov 16 '05 #2
΢ÈíÐÂÎÅ×é <fp*****@163.ne t> 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.createGrap hics();
c.drawImage(ima geparts,xcoodin ary,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 - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6547
by: BadOmen | last post by:
I have just ordered a IR remote control that uses a serial port. This is the one: http://www.rbmods.com/Articles/Eksitdata/IRremote/1.php There is some program out there I can use to con troll WinAmp,but i want to make my one... I have made a program that uses voice commands with MS Agent to control WinAmp5 now I want to use a IR remote instead of MS Agent. I just need to know how to receive the signal and handle it, how do I do that?
5
2421
by: DraguVaso | last post by:
Hi, I have my custom Inherited DataGrid. I override the OnPaint-event to speed up things and avoid flikkering using Double Buffering. To draw the normal things of the DataGrid I have to call the MyBase.OnPain(pe). But in my opinion it doesn't seem to be painted on the buffer. Everything works fine, but I think it should work better if my MyBase.OnPaint also painted in my buffer. Am I wrong? And how should I do this? I kind of need to...
12
4393
by: NewSun | last post by:
I draw a grid on a panel.And panel1' property AutoScroll is set true.When HScroollBar is Scroolling,the grid is error. I have rewritten the mathod of WndProc.But the effect is unexpected. How can i do? Thx a lot. Main codes go here: class frm private MyApp.Panel panel1; this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnPaint);
8
12275
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or Invalidate(Rectangle)) flickers in a nasty way when repainting. This does not happen in the Solitare (PC + WinCe) Versions a well as in a Card game where I have the C++ Source. The use of an empty OnPaintBackground brings no visable results.
2
302
by: ΢ÈíÐÂÎÅ×é | last post by:
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...
0
1508
by: SirThanxALot | last post by:
Dear all, This prblem is bothering me quite some time now... I have a Panel with a custom panels on top of iet on top of it. Now I need do perform some updates on all of the (15+). Understandably, all the small updates cause the OnPaint method to be called for the different Panel *and* for the containing Panel. However, I want all results to be displayed at once. In other words, how can I wait for all subpanels to be drawn, before...
8
2772
by: robert | last post by:
Hello, I want to put (incrementally) changed/new files from a big file tree "directly,compressed and password-only-encrypted" to a remote backup server incrementally via FTP,SFTP or DAV.... At best within a closed algorithm inside Python without extra shell tools. (The method should work with any protocol which allows somehow read, write & seek to a remote file.) On the server and the transmission line there should never be...
4
4631
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this program is like so: static void Main() {
0
939
by: Peter Webb | last post by:
I have started writing a small DirectX application to render 3D shapes (mostly boxes). I am planning on putting OnPaint into a separate thread with a timer, and just using single buffering (one screen). How much of the geometry should I put into the shared object(s)? For example, if I construct a box, should I store it as series of triangles in the main thread and pass these to OnPaint, or should I just pass the box corner...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.