Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to visualize the content of Graphics variable in Visual Studio 2010 during debug?

I am working on a rendering engine for my application and need to visualize the Graphics object during the debug session. I looked at Image Visualizers for VS2010, like this or this, but they visualize only the Image objects, whereas I need the Graphics. What could be a solution here?

Regards, Alexander.

like image 573
Alexander Galkin Avatar asked Jun 23 '11 18:06

Alexander Galkin


People also ask

How do you view the value of a variable?

Hover over a variable to see its value. The most commonly used way to look at variables is the DataTip. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable.

How do you view variables in VS code?

Set a breakpoint in your code, and start debugging by pressing F5 or selecting Debug > Start Debugging. When paused at the breakpoint, hover over any variable in the current scope. A data tip appears, showing the name and current value of the variable.

Which of the following windows display the variables while debugging?

The Autos and Locals windows show variable values while you are debugging. The windows are only available during a debugging session. The Autos window shows variables used around the current breakpoint.


1 Answers

I finally figured it out on my own.

To enable the visualisation of Graphics variables in VS2010 do the following:

  1. Download the Graphics Debugger Visualizer from this Code Project page (use the pre-compiled DLL version).
  2. Extract the DLL to the location where you have full rights.
  3. Right-click the DLL and press "Unblock" button on the first tab, in the right bottom corner. Click "Apply" and then "OK" to close the Properties Window.
  4. Copy the DLL to the following location:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers

    -or-

    C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers depending upon your system architecture.

  5. You don't have to restart VS2010, just run a debugging session and you'll see a small magnifying glass sign just to the left of the variable type name when you hover with you mouse cursor over your variable. Click this sign and you'll see the content of your Graphics object opened in a new window.

  6. Enjoy!
like image 93
Alexander Galkin Avatar answered Sep 20 '22 03:09

Alexander Galkin