Mql4 Color Transparency in Rectangle Object - mql4

Is it possible to add in color transparency to an object? Eg. I want to make 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

It's not immediately obvious from the ObjectCreate description. You have to make the object appear in the foreground and disable the filling as per the following code:
ObjectCreate(0,"Rectangle",OBJ_RECTANGLE,0,Time[10],Open[10],Time[0],Open[0]);
ObjectSetInteger(0,"Rectangle",OBJPROP_COLOR,clrBlack);
ObjectSetInteger(0,"Rectangle",OBJPROP_FILL,false);
ObjectSetInteger(0,"Rectangle",OBJPROP_BACK,false);

Related

How do I set tint color only for non white parts of the UIImage?

Simple I have UIImageView icon with two people and it looks like this:
but when I set tintColor to red it looks like this:
Is there any way to avoid covering every non zero-alpha pixel? I need to show the tie really there. One time I need people red, other time green.
The icon is simple png file. Rounded circle is simple background color of UIImageView. So the part of the image with tie cannot be zero-alpha.
Is there any way to achieve such effect WITHOUT creating images for every color?
This was similar to another idea I had been playing around with, so I did a little more fiddling...
Starting with these 3 images:
and then using them as .withRenderingMode(.alwaysTemplate) to give the desired colors... and then layering them via CALayer to get:
and an "exploded" view for clarity...
Create an image where the "people" are 100% transparent - effectively "holes" in the image.
Set the background color of the UIImageView to be the "fill" color.
You can still mask it with a circle (CAShapeLayer, for example), if you don't want a white bounding-box as part of the image.
Original images:
https://i.stack.imgur.com/eFrmB.png
https://i.stack.imgur.com/2GNDX.png
Use the CISpotColor filter:
https://developer.apple.com/library/content/documentation/GraphicsImaging/Reference/CoreImageFilterReference/#//apple_ref/doc/filter/ci/CISpotColor
This allows you to specify a color in your image that is to be changed into another color. Thus, since you know the original color of the tie and the background, you can change either of them, or both, in a single move.

How can i change the blue radiance effect of IOS map to a custom effect?

How can i add a custom ring effect around the blue dot. I need the rippling effect of the ring around the blue do to repeat quicker and its colour to be changed to red. Image
I don't think you can change that without using some hackish technique. But try the tintColor of the mapView.
If that does not work, try to use this library:
https://github.com/TransitApp/SVPulsingAnnotationView

Filling an image with color

I have an image and would like to fill it with color. The image is a flat bubble like the iOS 7 message app bubble. Basically, I want to use it as a shape. How can I do this?
I dont get your question to be honest :)
If you want a picture filled with color, either fill the picture in photoshop, and then use it in your code afterwards.
Otherwise make a circle with a div :) And just use background-color: black; or whatever color you want.

how to fill solid color into the shape of a transparent PNG file with actionscript3?

For example, I have a transparent png file, the shape is a car.
In the png file, I only draw the white border shape.
Outside and inside the border are all transparent.
I want to use actionscript3 code to show the car object with different color, it means only fill color inside the border, and for the outside of the border, keep transparent.
How to do that?
So far, the simplest workaround is to prepare many images with PhotoShop, but it's not good enough for me. When I have many shapes and use many colors, I've to prepare many many images.
Add more details:
(Because I'm using white border, you may not see the basic png file if your background of browser is white)
Change my boarder of shape to black, hope this is helpful to understand my question.
Since you're working with loaded images/pixels you can make use of BitmapData's floodFill() which pretty much does what you need. There's an example in bellow the method description as well.
It does pretty much what you need, although in some cases it might not be perfect. It's worth having a look at Jan's optimizing the floodFill() method article which goes more in depth.
A simple solution is to use multiple layers. The top layer would contain just the border. The lower layer would contain just the car with no border. You can adjust the colour of the car layer using a ColorTransform or ColorMatrixFilter.

Truly transparent gradient possible in Fireworks CS5?

Does anyone know if it's possible to have a gradient created using Fireworks to be really transparent at the bottom?
I'm trying to create a gradient which is truly transparent at the bottom, so it can be placed on top of another image. As far as I'm aware, even though the opacity of the bottom is 0, I still have to select a color for the bottom. This makes the top color blend into it (like below it's blending into white). So whenever the image is placed over a dark image the bottom is transparent but still white.
Hope that makes sense. Thanks for the help.
I usually achieve this effect by setting both color endpoints of the gradient to the same color, then adjusting the opacity endpoint to 0% (or whatever you want).
Here's the result: This is #666/100% to #666/0% on the left, #666/100% to white/0% on the right.
I was having the same problem you should try working with auto vector masks
Command>Creative>Auto Vector Mask
Great little tutorial here
http://www.communitymx.com/content/article.cfm?cid=b5f64
How are you defining "really transparent"?
You must choose a linear gradient, then a colour at each end of the gradient, and then make one end opacity 0%. It doesn't matter if it is a colour or not, you make it invisible anyway.
If you are comparing it to something like Photoshop or Illustrator, yes it's annoying that Adobe cannot be consistent with how each application handles opacity, but in Fireworks, it's still the same effect, just a different method of doing it.

Resources