Click here to Skip to main content
15,904,288 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Can windows application like c#.net be implemented using MVC Architecture Pin
kennster20-Dec-05 6:51
kennster20-Dec-05 6:51 
Questionmfc42ud.lib in VS.Net 2005 C++ Pin
Lythimer8-Dec-05 4:43
Lythimer8-Dec-05 4:43 
AnswerRe: mfc42ud.lib in VS.Net 2005 C++ Pin
Saksida Bojan11-Dec-05 20:58
Saksida Bojan11-Dec-05 20:58 
Questionuser in computer Pin
sebastianos7-Dec-05 9:35
sebastianos7-Dec-05 9:35 
AnswerRe: user in computer Pin
MarcelErz12-Dec-05 5:37
MarcelErz12-Dec-05 5:37 
AnswerRe: user in computer Pin
oykica13-Dec-05 6:27
oykica13-Dec-05 6:27 
QuestionCrystal Report Pin
farhha6-Dec-05 15:29
farhha6-Dec-05 15:29 
Questioncrystal report Pin
farhha6-Dec-05 7:12
farhha6-Dec-05 7:12 
QuestionToWords() Method within crystal Report Pin
achrafus6-Dec-05 2:11
achrafus6-Dec-05 2:11 
Question.Net Remoting on s Smart Device Pin
The Liquidian6-Dec-05 1:39
The Liquidian6-Dec-05 1:39 
AnswerRe: .Net Remoting on s Smart Device Pin
Gerben Jongerius7-Dec-05 6:43
Gerben Jongerius7-Dec-05 6:43 
QuestionDot Net Test Pin
Rabbit175-Dec-05 16:35
Rabbit175-Dec-05 16:35 
AnswerRe: Dot Net Test Pin
Robert Rohde6-Dec-05 6:24
Robert Rohde6-Dec-05 6:24 
QuestionGet Text from another application Pin
VOXVOXVOX5-Dec-05 6:10
VOXVOXVOX5-Dec-05 6:10 
AnswerRe: Get Text from another application Pin
lmoelleb6-Dec-05 20:53
lmoelleb6-Dec-05 20:53 
GeneralExcellent .NET Resource Pin
Faraz Ahmed5-Dec-05 6:02
Faraz Ahmed5-Dec-05 6:02 
GeneralRe: Excellent .NET Resource Pin
Ray Cassick5-Dec-05 8:04
Ray Cassick5-Dec-05 8:04 
GeneralRe: Excellent .NET Resource Pin
Faraz Ahmed5-Dec-05 23:58
Faraz Ahmed5-Dec-05 23:58 
GeneralRe: Excellent .NET Resource Pin
Ray Cassick6-Dec-05 5:44
Ray Cassick6-Dec-05 5:44 
QuestionRADIUS authentication Pin
JKroschel5-Dec-05 4:16
JKroschel5-Dec-05 4:16 
QuestionDeployment Problem Pin
fasttaxi4-Dec-05 23:08
fasttaxi4-Dec-05 23:08 
QuestionHaving trouble with pInvoke, weird behavior. Pin
dxben3-Dec-05 16:11
dxben3-Dec-05 16:11 
AnswerRe: Having trouble with pInvoke, weird behavior. Pin
dnewmon5-Dec-05 7:42
dnewmon5-Dec-05 7:42 
QuestionSecurity permisions for unmanaged code in .Net Applet Pin
TheDen3-Dec-05 4:43
TheDen3-Dec-05 4:43 
AnswerRe: Security permisions for unmanaged code in .Net Applet Pin
dnewmon3-Dec-05 8:58
dnewmon3-Dec-05 8:58 
The only way to do what you want here without using your unmanaged DLL is to create a Bitmap object and draw to it.

Example:
<br />
private Bitmap bmpCanvas;<br />
<br />
OnLoad(...) { bmpCanvas = new Bitmap(this.ClientSize.Width, this.ClientSize.Height); }<br />
OnResize(...) { bmpCanvas = new Bitmap(this.ClientSize.Width, this.ClientSize.Height); }<br />
<br />
OnDrawRect(...) {<br />
  Graphics g = Graphics.FromImage(bmpCanvas);<br />
  g.DrawRectangle(...);<br />
  g.Dispose();<br />
}<br />
<br />
OnPaint(object sender, PaintEventArgs pe) {<br />
 pe.Graphics.DrawImage(bmpCanvas, 0, 0);<br />
}<br />


After this has been implemented you can start streaming fairly easily:

// Pre-Buffer alittle maybe:
MemoryStream stream = new MemoryStream(bmpCanvas.Width * cmpCanvas.Height * 3);

// Stream as PNG (loss-less and has good compression):
bmpCanvas.SaveImage(stream, ImageFormat.Png);

You can then call stream.GetBuffer() and use stream.Length to send the data.

You might want to ensure the user is complete and dispose of the Bitmap to reduce the memory footprint.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.