Click here to Skip to main content
15,914,444 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: Drawing with controls question [modified] Pin
kensai3-May-08 6:36
kensai3-May-08 6:36 
GeneralRe: Drawing with controls question Pin
Luc Pattyn3-May-08 7:02
sitebuilderLuc Pattyn3-May-08 7:02 
QuestionImage Autobalance Pin
camiel2-May-08 7:40
camiel2-May-08 7:40 
QuestionErase old Text, despite picture in Background Pin
indogerman2-May-08 0:44
indogerman2-May-08 0:44 
AnswerRe: Erase old Text, despite picture in Background Pin
Christian Graus3-May-08 1:42
protectorChristian Graus3-May-08 1:42 
QuestionRefresh graphic on screen Pin
cocoonwls30-Apr-08 0:12
cocoonwls30-Apr-08 0:12 
AnswerRe: Refresh graphic on screen Pin
Cedric Moonen30-Apr-08 2:43
Cedric Moonen30-Apr-08 2:43 
GeneralRe: Refresh graphic on screen Pin
cocoonwls1-May-08 15:57
cocoonwls1-May-08 15:57 
Hi Cedric,

Thanks for reply, I am using buffer graphic (GDI technologies in c#)to draw into off screen. then use Render() method to display on screen.Note that, these drawing method is develop in my Custom User Control. here are some samples code :

FrmMain : TimewayChartControl

private void DrawChart()<br />
{<br />
     TimewayChartControl.CreatBufferGraphics();   <-----create buffergraphic<br />
     TimewayChartControl.RenderLinePath();        <-----draw line<br />
}



Custom Control:

BufferedGraphicsContext CurrentContext = BufferedGraphicsManager.Current;<br />
BufferedGraphics bg;


public void CreatBufferGraphics()<br />
{<br />
    bg = CurrentContext.Allocate(this.CreateGraphics(), this.ClientRectangle);<br />
    bg.Graphics.TextRenderingHint = TextRenderingHint.AntiAlias;<br />
    bg.Graphics.Clear(this.BackColor);<br />
}


private void DrawLinePath(Graphics g)<br />
{<br />
    //some coding here.....<br />
    g.DrawPath(LinePathPen, gpLine);<br />
}


protected override void OnPaint(PaintEventArgs pe)<br />
{<br />
   //draw the image into the screen<br />
   bg.Render(pe.Graphics);<br />
}



Everytime when after i draw the first graphic, the second graphic which i draw will not render unless some frame or other form move over the painting area, then only the second graphic will appear and erase the first graphic.... I am not sure what was happenConfused | :confused:
GeneralRe: Refresh graphic on screen Pin
cocoonwls1-May-08 22:49
cocoonwls1-May-08 22:49 
GeneralRe: Refresh graphic on screen Pin
Cedric Moonen2-May-08 23:31
Cedric Moonen2-May-08 23:31 
GeneralRe: Refresh graphic on screen [modified] Pin
Baltoro4-May-08 11:41
Baltoro4-May-08 11:41 
GeneralRe: Refresh graphic on screen Pin
cocoonwls4-May-08 20:42
cocoonwls4-May-08 20:42 
GeneralClosing stream after calling Bitmap.Save Pin
jchalfant25-Apr-08 6:20
jchalfant25-Apr-08 6:20 
GeneralRe: Closing stream after calling Bitmap.Save Pin
Mark Salsbery25-Apr-08 7:36
Mark Salsbery25-Apr-08 7:36 
GeneralRe: Closing stream after calling Bitmap.Save Pin
Christian Graus28-Apr-08 14:30
protectorChristian Graus28-Apr-08 14:30 
GeneralLaggy GIF Problem Pin
Reelix24-Apr-08 20:27
Reelix24-Apr-08 20:27 
GeneralRe: Laggy GIF Problem Pin
Randor 28-Apr-08 14:04
professional Randor 28-Apr-08 14:04 
GeneralRe: Laggy GIF Problem Pin
Reelix28-Apr-08 20:49
Reelix28-Apr-08 20:49 
GeneralRe: Laggy GIF Problem Pin
Randor 29-Apr-08 3:59
professional Randor 29-Apr-08 3:59 
GeneralDrawing to Bitmap Pin
cocoonwls20-Apr-08 21:54
cocoonwls20-Apr-08 21:54 
GeneralRe: Drawing to Bitmap Pin
cocoonwls20-Apr-08 23:58
cocoonwls20-Apr-08 23:58 
GeneralReal time video Pin
Chandrias20-Apr-08 4:38
Chandrias20-Apr-08 4:38 
GeneralRe: Real time video Pin
Mark Salsbery21-Apr-08 21:27
Mark Salsbery21-Apr-08 21:27 
Questionis directx installed? Pin
bart00019-Apr-08 5:37
bart00019-Apr-08 5:37 
AnswerRe: is directx installed? Pin
Christian Graus20-Apr-08 11:59
protectorChristian Graus20-Apr-08 11:59 

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.