Is it possible to watch BufferedImage objects while debugging in IntelliJ?
I mean to view visual content of an image, not memory identity.
Is it also possible to view custom objects visually, i.e. write some custom visualizers?
On the right-hand side of the debug window, click the button called Trace Current Stream Chain. This tells IntelliJ IDEA to evaluate our stream, and this is how you get your visual representation.
To view a table, double-click the table. For more information about different viewing modes, see View data. The available data sources are shown as a tree of data sources, schemas, tables and columns. If no data sources are currently defined, use the New command Alt+Insert to create a data source.
You can customize how threads are displayed on the Frames and Threads tabs. It might be helpful when you are working on a multithreaded application and often need to access information about your threads. Right-click anywhere in the Frames or Threads tab and select Customize Threads View.
IntelliJ IDEA 2016.1.1 is able to display BufferedImage
object as image while debugging by default (probabily previous versions also support this feature).
BufferedImage
objectBufferedImage
class Idea will set Image viewer, so you can simply click on the View image text in the row of the BufferedImage
object in the debugger window, on the very right hand side. This is also available in the Evaluate Expression window.
BufferedImage
class, you can change it back by right clicking on the BufferedImage
object in the debugger window, and select View as / Image.The image will be loaded in a popup window. (You can resize the the popup, but cannot move. I'm on OS X, the window handling of Idea is a bit weird here, maybe better on Win)
You can also create your own object visualizers. This can also be done in the View as context menu, in this case choose the Create... option. There you can enter your custom expression, which will be displayed in the row of the object in the debugger window. Please note that this is for displaying information of the object in text format only.
For example if you want to display the BufferedImage
as [width]x[height]
in the debugger window, create a new view, select Use following expression radio button, and enter the following expression:
getWidth() + "x" + getHeight()
After clicking Apply or OK, you will get:
You can manage your viewers by right clicking in the Variables or Watches panel, and select Customize Data Views...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With