Peter, you have a problem with the edges of the icons. It's very jarring.
This is because you don't mix the colour that uses the alpha channel with the background. here is the necessary function to mix two colours that use the alpha channel.
void MixColor(uint clr, uint &addr) { // mix the color in the cell at addr with the color clr and enter the new value in the same cellif (GETRGBA(addr) == 0) {
addr = clr;
return;
}
union argb {
uint clr;
uchar c[4];
} C;
C.clr = clr;
if (C.c[3] == 0) return;
if (C.c[3] == 255) {
addr = clr;
return;
}
argb Bg;
Bg.clr = addr;
float a = C.c[3] / (float)255.0;
float b = Bg.c[3]/ (float)255.0;
float ab = b+a-b*a;
C.c[3]=uchar(ab*255+0.49999);
if (ab>0.002) {
float a0 = a/ab;
float a1 = b*(1-a)/ab;
C.c[2] = uchar(C.c[2]*a0+Bg.c[2]*a1);
C.c[1] = uchar(C.c[1]*a0+Bg.c[1]*a1);
C.c[0] = uchar(C.c[0]*a0+Bg.c[0]*a1);
}
addr = C.clr;
}
Peter, you have a problem with the edges of the icons. It's very hard on the eye.
This is because you don't mix the colour that uses the alpha channel with the background. here is the necessary function for mixing colours that use the alpha channel.
There is no trouble, because that's the way the icons are. Note, the 16×16 icons are fine (much less jarring to the eye). Only 32×32 icons have this defect. The reason is the source I downloaded them from. :)
You just have to "steal" better quality labels. Lol.
Well in general, you're right. It's better to work with colour.
There is no trouble, because that's the way the icons are. Note, the 16×16 icons are fine. Only the 32×32 icons have this defect. The reason is in the source I downloaded them from. :)
You just have to "steal" better quality labels. Lol.
there are many sources now with normal png icons with transparent backgrounds.
there are many sources with normal png icons with transparent background. See for yourself, of course, but your GUI will look much better without this pixelation on the edges.
I'm not arguing... Of course it would look better. By the way, I handle icons pretty well. Pay attention to their shadow on the taskbar buttons. I make the background transparent. But there is colour "rubbish" in the pixels, which is difficult to identify programmatically. Like these flecks on the edges. They are not strictly one colour and it is difficult to separate them from the icon itself to remove them. That's the problem.
We need better icons. Without pixelated "rubbish".
Реter Konow #: I'm not arguing. Of course it would look better. By the way, I do a pretty good job on the icons. Notice their shadow on the taskbar buttons. I make the background transparent. But there is colour "rubbish" in the pixels, which is difficult to identify programmatically. Like these flecks on the edges. They are not strictly one colour and it is difficult to separate them from the icon itself to remove them. That's the problem.
We just need better icons. Without the pixelated "rubbish".
There is no rub bishin normal png with transparent background. Rubbish appears when processing is wrong. The correct function was given above.
I used to do the same with shadows. Now I don't do that anymore. Modern fashion without shadows, gradients and curls. Minimalism in short, which is in favour of rendering performance.
in normal png with transparent background there is no rubbish. Rubbish appears at incorrect processing. The correct function was given above.
...
Everything is like that, if you don't download icons "piratically", as I did many years ago. ))) Then there is nothing much to process, because the background is marked with -1.
In this case, my algorithm inserts the underlying colour from the pixel surface under the icon. Even the transparency doesn't need to be "tweaked".
But if instead of -1 the pixel has some other colour, it is unrealistic to separate it from the rest, and transparency functions will not help. That's the point.
But if a pixel has a different colour instead of -1, then it is unrealistic to separate it from the rest, and transparency functions won't help. Here's the thing.
I'm talking about png icons with transparent background (with alpha channel).
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Peter, you have a problem with the edges of the icons. It's very jarring.

This is because you don't mix the colour that uses the alpha channel with the background.
you can also see how to work with pnghere is the necessary function to mix two colours that use the alpha channel.
https://www.mql5.com/en/code/45439
Peter, you have a problem with the edges of the icons. It's very hard on the eye.
This is because you don't mix the colour that uses the alpha channel with the background.
you can also see how to work with pnghere is the necessary function for mixing colours that use the alpha channel.
https://www.mql5.com/en/code/45439
Hello, Nikolai!
there are many sources now with normal png icons with transparent backgrounds.
For example:
https://pngtree.com/so/colored-icons
See for yourself, of course, but your GUI will look much higher quality without those edge artefacts.
there are many sources with normal png icons with transparent background.
See for yourself, of course, but your GUI will look much better without this pixelation on the edges.
now there are many sources with normal png icons with transparent background.
For example:
https://pngtree.com/so/colored-icons
I'm not arguing. Of course it would look better. By the way, I do a pretty good job on the icons. Notice their shadow on the taskbar buttons. I make the background transparent. But there is colour "rubbish" in the pixels, which is difficult to identify programmatically. Like these flecks on the edges. They are not strictly one colour and it is difficult to separate them from the icon itself to remove them. That's the problem.
There is no rub bishin normal png with transparent background. Rubbish appears when processing is wrong. The correct function was given above.
I used to do the same with shadows. Now I don't do that anymore.
Modern fashion without shadows, gradients and curls.
Minimalism in short, which is in favour of rendering performance.
in normal png with transparent background there is no rubbish. Rubbish appears at incorrect processing. The correct function was given above.
...
I'm talking about png icons with transparent background (with alpha channel).