Recent

Author Topic: How to See MyBitmap.width in the Watches  (Read 2082 times)

Possum

  • Jr. Member
  • **
  • Posts: 69
    • uDoPage
How to See MyBitmap.width in the Watches
« on: February 10, 2019, 02:47:13 am »
Hi

I would like to see MyBitmap.with from the debugger. I tried to add

MyBitmap.width

In the watch list but this didn't work. I got

<Error: Type TBITMAP has no component named WIDTH.>

Is there a way for me to see component details like width in the debugger.

Thank You.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: How to See MyBitmap.width in the Watches
« Reply #1 on: February 10, 2019, 04:03:11 am »
You can (temporary) use a variable when debugging:

Code: Pascal  [Select][+][-]
  1. var
  2.   TestValue: LongInt;
  3.  
  4. // ...
  5.  
  6.   TestValue := MyBitmap.Width;
« Last Edit: February 10, 2019, 04:05:44 am by Handoko »

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: How to See MyBitmap.width in the Watches
« Reply #2 on: February 10, 2019, 10:35:49 am »
In the debugger you can query properties which map directly to object variables, i.e. which do not have a getter function, usually by asking for the property name with prefix "F", e.g. bitmap.FPixelFormat for the pixelformat. Unfortunately, the property "Width" is provided by a getter function GetWidth and thus cannot be evaluated this way, and you must use Handoko's way.

 

TinyPortal © 2005-2018