User Profile

Collapse

Profile Sidebar

Collapse
walentys
walentys
Last Activity: Jan 24 '12, 10:47 AM
Joined: Jul 30 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • walentys
    replied to Design Question
    Okay, thanks for your help.

    I just have seen that most people, including even in this community, frown upon retrieving a variable via a string (its name). I figured the same would apply here. But I guess in some cases it is acceptable for such behavior, especially when it would simplify the code so greatly.
    See more | Go to post

    Leave a comment:


  • walentys
    replied to Design Question
    Nothing in particular, wouldn't it just slow it down? It seems a little excessive...get ting a method name from a file, passing the string to look up a symbol name of the very program you're running in currently...whe n all you really need to do (though it might be uglier) is just call the damn method in the program. I was merely trying to look for a non-ugly way, maybe, avoiding reflection.

    Thanks for being patient with me.
    See more | Go to post

    Leave a comment:


  • walentys
    replied to Design Question
    That would be fine, I don't care what the methods are named....but even then, how would I go about matching up that byte coming in to that function named "2A"? Do I have to resort to reflection?
    See more | Go to post

    Leave a comment:


  • walentys
    replied to Design Question
    You are pretty much correct. I will have hundreds of methods, which is why I chose a delegate system as I don't want this:

    Code:
    switch (code)
    {
       case 0x28:
        RunADD();
        break;
       case 0x2A:
        RunJMP();
        break;
       //so on...
    }
    However, they are parameterless methods...they don't take a byte (actually I haven't decided that yet, they MIGHT have parameters...
    See more | Go to post

    Leave a comment:


  • walentys
    started a topic Design Question

    Design Question

    Okay so I've got a delegate called "InstructionRun " (just a simple void with no parameters), and a class called "Instructio n" which contains a delegate InstructionRun object as a member variable, as well as a method called "Run" which just calls the InstructionRun object's current functionality. There is also a byte in this class called "code".

    Another class ("Instructions" ) has a...
    See more | Go to post

  • walentys
    replied to C# PictureBox Help
    in .NET
    I just went down to the byte level of the image instead of the sluggish Get and SetPixel(), and now it works much faster. If anyone wants help with how I did this, feel free to ask.
    See more | Go to post

    Leave a comment:


  • walentys
    replied to C# PictureBox Help
    in .NET
    Changing the actual pixels of the picturebox's image is very rigid, but also very sluggish. I'd rather use the Draw methods of the Graphics class, but I'm still having problems with redrawing. Any ideas to get it close to as rigid as changing the actual pixels?

    Any more help would be appreciated,
    Scott
    See more | Go to post

    Leave a comment:


  • walentys
    replied to C# PictureBox Help
    in .NET
    Thanks for the advice.

    It's weird now. Now it does redraw, but only when I move the Notepad window slowly enough. If I move it fast, it never comes back.
    See more | Go to post

    Leave a comment:


  • walentys
    started a topic C# PictureBox Help
    in .NET

    C# PictureBox Help

    I have a PictureBox that draws an image and then a rectangle. However, annoyingly, any other window that I put over the rectangle causes it not to redraw. (I can cut out half of the rectangle by opening Notepad and placing it over half of it, or all of it by minimizing and then maximizing)

    Here is my code:

    Code:
            private void Refresh_PictureBox()
            {
                Graphics g = pictureBox1.CreateGraphics();
    ...
    See more | Go to post
No activity results to display
Show More
Working...