Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Anthony Baraff

@Anthony Baraff
About
Posts
5
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • graphics.Clear(color) - Incorrect color!
    A Anthony Baraff

    The human eye is more sensitive to differences in green.

    C# graphics help tutorial question

  • Reading Text file
    A Anthony Baraff

    Something like this:

    FileStream fs = new FileStream(_sFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
    StreamReader reader = new StreamReader(fs);
    ArrayList dates = new ArrayList();
    ArrayList data = new ArrayList();
    char[] sep = {','};
    while(reader.Peek() != -1)
    {
    string[] rec = reader.ReadLine().Split(sep);
    double[] record = new double[rec.Length];
    for(int i = 0; i < rec.Length; i++)
    {
    if(Char.IsLetter(rec[i],0))
    record[i] = 0d;
    else
    {
    try
    {
    record[i] = double.Parse(rec[i]);
    }
    catch
    {
    record[i] = 0d;
    }
    }
    }
    data.Add(record);
    }
    double[][] dData = (double[][])data.ToArray(typeof(double[]));
    reader.Close();
    fs.Close();
    reader = null;
    fs = null;

    C# csharp data-structures question

  • gdi+ slow
    A Anthony Baraff

    If you do want to use DirectX take a look at overlays. That will allow you to create an area within your window to draw your charts without giving up all of the other UI niceties of C# and GDI+. My guess is that there isn’t anything here that you can’t do using GDI+. Here are a few things to check: Are you redrawing the background of your graph each time? It’s likely that a large number of drawing commands are spent redrawing an unchanging background every time the graph is drawn. Try caching the background and Blit it to your graph area. Are you using DrawLine or DrawLines? DrawLines is much faster. Is it really the drawing that is slow? Have you looked at the code with a profiler to see which methods are taking the longest? Regarding the double buffering, are you doing the buffering yourself in an off-screen object, or are you using the double buffer control style? Also, what are the timers for?

    C# graphics game-dev question winforms hardware

  • gdi+ slow
    A Anthony Baraff

    What are you actually trying to do that is causing refresh problems? Maybe, there's another work-around.

    C# graphics game-dev question winforms hardware

  • memory over flow
    A Anthony Baraff

    From MSDN Library: When you are finished sending and receiving data, use the Shutdown method to disable the Socket. After calling Shutdown, call the Close method to release all resources associated with the Socket.

    C# performance help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups