Color Transparency in Rectangle Object

 

Hello,

 Is it possible to add in color transparency to an object?  Eg.  I want to take a rectangle and instead of making it while #ffffff i wanted to make it transparent.  

 

I was wondering if anyone can show me some example code to do this?

 

Thank you 

 
trader88888:

Hello,

 Is it possible to add in color transparency to an object?  Eg.  I want to take a rectangle and instead of making it while #ffffff i wanted to make it transparent.  

 

I was wondering if anyone can show me some example code to do this?

 

Thank you 

All is explained on this article.
 
Thank you, very helpful and didn't find that.  Since this example is in mql5 i imagine this isn't possible on mql4?
 
trader88888:
Thank you, very helpful and didn't find that.  Since this example is in mql5 i imagine this isn't possible on mql4?
It should be similar if not the same, I didn't check.
 
trader88888:
Thank you, very helpful and didn't find that.  Since this example is in mql5 i imagine this isn't possible on mql4?

Since "angevoyageur" is also a moderator, if he has recommended the article to you, then it is because it is also relevant to MQL4+ (even if it is geared for MQL5).

Why don't you simply try out a few examples and find-out for yourself?

Currently MetaQuotes is slowly merging the two platforms into one, so learning the MQL5 way of doing things is only going to benefit you in the long run.

 
Hello.
I am here only on the personal request of angevoyageur.
Transparent object may be, if you use canvas. All scripts from my articles (of canvas) work in MQL4. And the General Council: it is time to work on MQL5:).
I've gone back to "5" Forum.
 
angevoyageur:
It should be similar if not the same, I didn't check.
Yes, totally the same.
 
Doerk:
Yes, totally the same.

How did you do it?

I just refer the link and read the article. Use definition of transparent  C'0,0,0'/ 0x000000  as the visual effect which I want, but no transparent effect at all?

My compiling platform MetaQuotes 4  Version : 4.00 Build 1010    18 Aug 2016

Pls give me some adivce or hints! Thanks in advance!   

//+------------------------------------------------------------------+
//| Account Statistics function                    |
//+------------------------------------------------------------------+
bool AccountInfo()
{  
   if(Set_Hide)
   {
      if(!RectLabelCreate(0,"Statistics",0,xRec,yRec,xRec_size,yRec_size,0x000000,
            BORDER_FLAT,CORNER_LEFT_UPPER,clrWhite,STYLE_SOLID,1,false,false,false,1))
       {
           string Err=GetLastError();
           Print("Error creating Rectangle Label. Error code ",Err,". ",ErrorDescription(Err));
       } 
       Set_Hide = false; 
   }
}
RectangleLable Transparent Effect Failed

 


	          
 

Hi Alain,

I had the same question as the original post. I've read through that article in full, and my apologies if I've not understood it well enough, but I still can't see how to draw a transparent OBJ_RECTANGLE.

The article you've linked gives a great explanation for how to apply transparency (and much more) to CCanvas objects, but I'm trying to bind transparent rectangles to the chart, so that it would rescale and shift accordingly as users adjust the chart and new candles are plotted.

Can CCanvas objects be bound to the chart and shift out of view accordingly? I can only see how to plot them to the coordinates within the visible screen, independent of chart movements.

Thanks!

 
Bill M #:

Hi Alain,

I had the same question as the original post. I've read through that article in full, and my apologies if I've not understood it well enough, but I still can't see how to draw a transparent OBJ_RECTANGLE.

The article you've linked gives a great explanation for how to apply transparency (and much more) to CCanvas objects, but I'm trying to bind transparent rectangles to the chart, so that it would rescale and shift accordingly as users adjust the chart and new candles are plotted.

Can CCanvas objects be bound to the chart and shift out of view accordingly? I can only see how to plot them to the coordinates within the visible screen, independent of chart movements.

Thanks!

working, see here: https://www.mql5.com/en/forum/159329/page3#comment_51358617

Object overlapping color problem
Object overlapping color problem
  • 2021.09.18
  • www.mql5.com
Hi I have seen If two object crossed with each other then the cross section get white or in other color. Is there any way to avoid that...