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

.NET (Core and Framework)

 
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.
GeneralRe: Security permisions for unmanaged code in .Net Applet Pin
TheDen3-Dec-05 9:36
TheDen3-Dec-05 9:36 
GeneralRe: Security permisions for unmanaged code in .Net Applet Pin
dnewmon3-Dec-05 10:02
dnewmon3-Dec-05 10:02 
GeneralRe: Security permisions for unmanaged code in .Net Applet Pin
TheDen3-Dec-05 10:17
TheDen3-Dec-05 10:17 
QuestionInstalling J# Redistrubutable Silently Pin
Farm Developer3-Dec-05 1:36
Farm Developer3-Dec-05 1:36 
Question.NET SDK Question Pin
akyriako782-Dec-05 21:55
akyriako782-Dec-05 21:55 
AnswerRe: .NET SDK Question Pin
Dave Kreskowiak3-Dec-05 4:03
mveDave Kreskowiak3-Dec-05 4:03 
AnswerRe: .NET SDK Question Pin
André Ziegler3-Dec-05 8:29
André Ziegler3-Dec-05 8:29 
QuestionVSTO excel locking Pin
Drew McGhie2-Dec-05 7:13
Drew McGhie2-Dec-05 7:13 
Questioni need a coding for converting text to speech Pin
dotnetkoders1-Dec-05 23:34
dotnetkoders1-Dec-05 23:34 
AnswerRe: i need a coding for converting text to speech Pin
jonathan152-Dec-05 2:36
jonathan152-Dec-05 2:36 
GeneralRe: i need a coding for converting text to speech Pin
Colin Angus Mackay3-Dec-05 10:04
Colin Angus Mackay3-Dec-05 10:04 
GeneralRe: i need a coding for converting text to speech Pin
Yuvi Panda9-Dec-05 16:18
Yuvi Panda9-Dec-05 16:18 
QuestionVSTO (Save as Version Word 2000) Pin
krisp1-Dec-05 14:56
krisp1-Dec-05 14:56 
QuestionNested classes and dialogs Pin
LHBalloti1-Dec-05 11:11
LHBalloti1-Dec-05 11:11 
AnswerRe: Nested classes and dialogs Pin
S. Senthil Kumar2-Dec-05 21:32
S. Senthil Kumar2-Dec-05 21:32 
QuestionATL Server Web Service Pin
linuxfreak1-Dec-05 7:31
linuxfreak1-Dec-05 7:31 
QuestionFeature/Addon to get the (C#) CODE sorted? Pin
eclipse2k11-Dec-05 5:48
eclipse2k11-Dec-05 5:48 

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.