Canvas is cool! - page 14

 
Nikolai Semko:

So you didn't hear my message.

But you have to round off the double numbers to give the coordinates. There's no other way.

 
Реter Konow:

But you have to round off the double numbers to give the coordinates. There is no other way.

You don't have to round anything.

Here is a script, as an example.

Run it first with default parameters (with smoothed circles and coordinates and dimensions of type double)

and then run it with parameter typ = not_smoothed_circles (with antialiased circles and coordinates and sizes of int type - from CCanvas class).

and you'll see what I mean.

It's better to do it on white background, not on black one

Files:
 
Nikolai Semko:

Based on Doom...

I wonder why the picture freezes while scrolling the chart with the mouse?


It's a shame you can't kill a resource. For example, you turn off the flame indicator. And the object with the resource is left hanging. Object can be killed, but the resource - no. In the end, it's easy to eat all of the Terminal's memory and thus imperceptibly disable the Expert Advisors.

 

There are plenty of 3D libraries written in JavaScript for a hundred years now. The easiest and most direct way is to rewrite them from there to here.

Not for 100 years, of course, but a few.

 
fxsaber:

I wonder why the picture freezes while scrolling the chart with the mouse?

it must be because of the CHARTEVENT_CHART_CHANGE event control in my iCanvas class

there is no such control in the script and there is no freezing.

Files:
fire.mq5  9 kb
 
Nikolai Semko:

You don't have to round anything.

Here is a script as an example.

Run it first with default parameters (with antialiased circles and coordinates and dimensions of type double)

and then run it with parameter typ = not_smoothed_circles (with antialiased circles and coordinates and sizes of int type - from CCanvas class).

and you'll see what I mean.

It's better to do it on white background, not black.

Yes, it looks very good. Quality shapes of circles.

But, you are using CCanvas class, and there the coordinates are set in int.

 
fxsaber:

I wonder why the picture freezes while scrolling the chart with the mouse.


It's a pity that you can't kill a resource. For example, you turn off the flame indicator. And the object with the resource is left hanging. Object can be killed, but the resource - no. It simply eats up all the Terminal's memory and therefore inconspicuously disables the Expert Advisors.

And ResourseFree()?

 
fxsaber:

It's a shame that you can't kill a resource. For example, you turn off the flame indicator. It leaves an object with a resource hanging. You can kill the object, but not the resource. In the end, you can easily eat the whole Terminal's memory and, therefore, imperceptibly disable the Expert Advisors.

But why?

I use a destructor in my class

~iCanvas() { Destroy(); ChartRedraw();};

and Destroy:

void CCanvas::Destroy(void)
  {
//--- delete object
   if(m_objname!=NULL)
     {
      ObjectDelete(m_chart_id,m_objname);
      m_chart_id=0;
      m_objname =NULL;
      m_objtype =WRONG_VALUE;
     }
//--- deallocate array
   ArrayFree(m_pixels);
//--- free resource
   if(m_rcname!=NULL)
     {
      ResourceFree(m_rcname);
      m_rcname=NULL;
     }
//--- zeroize data
   m_width =0;
   m_height=0;
  }
 
Nikolai Semko:

this is probably due to the control of the CHARTEVENT_CHART_CHANGE event in my iCanvas class

In the script, there is no such control and there is no freezing.

Yes, no problem in the script.


Very curious how it would look.

Forum on trading, automated trading systems and strategy testing

New version of MetaTrader 5 build 1930: Floating chart windows and .Net libraries in MQL5

fxsaber, 2019.01.14 21:37

Remains to make a pull-out picture of the think with the gas tap off.

But what's really spectacular is setting the bars and object lines themselves on fire.


You could also make the bars as if they were slits in the furnace. It's as if you're watching the flames through them.


This takes a bit of work: create a second Canvas buffer as a copy of the main flame, and then apply a filter on the pixel location of the bars. It shouldn't be difficult, at first glance.

 
Nikolai Semko:

Why is that?

I use a destructor in my class

and Destroy:

Well then for some reason it didn't work, as I have everything left.