473,382 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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.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 ?

THX!

Nov 16 '05 #1
2 2897
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.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
Image img = pictureBox1.Image;
Graphics g = Graphics.FromImage(img);
g.drawImage(imageparts,xcoodinary,ycoodinary);
pictureBox1.Image = img;

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

Nov 16 '05 #2
΢ÈíÐÂÎÅ×é <fp*****@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 - <sk***@pobox.com>
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
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...
5
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...
12
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...
8
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...
2
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...
0
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+)....
8
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...
4
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.