Is it possible to output text on multiple lines in an OBJ_TEXT object? - page 4

 
Alexey Viktorov:

That's it, I've got it.

Alignthe OBJ_BITMAP_LABEL object to the right edge, you may indent it vertically and horizontally, set OBJPROP_ANCHOR to ANCHOR_RIGHT_UPPER. Then the width of the image is set when creating the resource. And this value should be put in TextOut as second parameter and then text will be aligned on right side of canvas.

:), original.

 

New question: Can I read text from a resource in kanvas?

For example these lines, or any of them.

Forum on trading, automated trading systems and strategy testing

Is it possible to output text in multiple lines in OBJ_TEXT object?

Alexey Viktorov, 2019.03.08 10:10

Figured it out.

The OBJ_BITMAP_LABEL object should be aligned by the right edge, you may indent it vertically and horizontally, OBJPROP_ANCHOR should be ANCHOR_RIGHT_UPPER. Then the width of the image is set when creating the resource. And this value should be put in TextOut as second parameter and then text will be aligned on right side of canvas.

Purpose: There is a line with kanvas, which contains date. It is this date that we want to read.

Or apply one of the old tried and tested methods, GV, file, graphic or whatever.

 
Alexey Viktorov:

New question: Can I read text from a resource in kanvas?

If from a kanvas, you can't read it, but recognize it. It's an image.

But if you have access to the code that generates this kanvas, you can add a date saving to the Main Variable next to it.

 
Andrey Khatimlianskii:

If from a canvas, it's not to read, it's to recognise. This is an image.

But if you have access to the code that generates this kanvas, you can add a date saving to the Main Variable next to it.

It's too simple in GV))). I wanted to make such a mess, I would not have figured it out myself later on.

I didn't think it was a picture, though. There really aren't any options here. You can't plug in a text recognizer.)

 
Alexey Viktorov:

It's too easy in GV.)) I wanted to make it so complicated that I wouldn't have been able to figure it out myself.

And that it is a picture, I something and did not think. There really are no options here. You don't have to plug in a text recognizer.)

There's another problem here.
If you don't have access to the code that generated the kanvas, then you don't have access to the resource of that kanvas either. You can see the list of bitmap objects, but not the list of resources. If you don't know the name of the resource, you can only find it out by matching or brute force, which is beyond practical application.
How do you get an array of points for recognition? If only through a screenshot, which is also nonsense.
Or am I wrong?

 
Nikolai Semko:

There's another problem here.
If you don't have access to the code that generated the kanvas, then you don't have access to the resource of that kanvas either. You can see the list of bitmap objects, but not the list of resources. If you don't know the name of the resource, you can only find it out by matching or brute force, which is beyond practical application.
How do you get an array of points for recognition? Unless through a screenshot, which is also nonsense.
Or am I wrong?

Can PixelGet() be used as a tool to retrieve a pixel of a part of the recognised image?

Документация по MQL5: Стандартная библиотека / Пользовательская графика / CCanvas / PixelGet
Документация по MQL5: Стандартная библиотека / Пользовательская графика / CCanvas / PixelGet
  • www.mql5.com
Стандартная библиотека / Пользовательская графика / CCanvas / PixelGet - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Artyom Trishkin:

Can PixelGet() be used as a tool to retrieve a pixel of a part of the recognised image?

As I understand it, we are talking about accessing a canvas not generated by our program. That's a bummer.
 
Nikolai Semko:

There is another problem here.
If you don't have access to the code that generated the canvas, then you don't have access to the resource of that canvas either. You can see the list of bitmap objects, but not the list of resources. If you don't know the name of the resource, you can only find it out by matching or brute force, which is beyond practical application.
How do you get an array of points for recognition? If only through a screenshot, which is also nonsense.
Or am I wrong?

The bitmap property has a path to the resource. I don't know if this can be retrieved programmatically.

resource

 
Andrey Barinov:

The bitmap property has a path to the resource. I don't know if you can get it programmatically.

Oh, I didn't know that one. Thank you!
But you can't get to its name programmatically, can you?
 
Nikolai Semko:
Oh, I didn't know that one. Thank you!
But you can't get to his name programmatically, can you?

I think we can: https://www.mql5.com/ru/docs/constants/objectconstants/enum_object_property#enum_object_property_string


OBJPROP_BMPFILE

Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Все объекты, используемые в техническом анализе, имеют привязку на графиках по координатам цены и времени – трендовая линия, каналы, инструменты Фибоначчи и т.д.  Но есть ряд вспомогательных объектов, предназначенных для улучшения интерфейса, которые имеют привязку к видимой всегда части графика (основное окно графика или подокна индикаторов...
Reason: