This repo contains the foundational libraries that make up the .NET Core development stack.
carlossanlop on 2.1
carlossanlop on 2.1
carlossanlop on 2.2
carlossanlop on 2.2
carlossanlop on 3.0
carlossanlop on 3.0
carlossanlop on 3.1
carlossanlop on 3.1
carlossanlop on 3.1
carlossanlop on 3.1
Merged PR 26805: Build Microsof… Backport SqlClient 659 to relea… Merged PR 26813: Remove Debian.… and 11 more (compare)
carlossanlop on 3.1
@alealpha2000 maybe what is the issue?
I want to add a background image with a transparent dropshadow to a form in winforms. i managed to draw the background with UpdateLayeredWindow but now I'm stuck since apparently you have to draw the controls inside the form into the bitmap that is drawn with UpdateLayeredWindow
private void SimulateTransparency(PaintEventArgs pevent)
{
//simular transparencia
var graphicsContainer = pevent.Graphics.BeginContainer();
pevent.Graphics.TranslateTransform(-Left, -Top);
var paintEvents = new PaintEventArgs(pevent.Graphics, Bounds);
base.InvokePaintBackground(Parent, paintEvents);
base.InvokePaint(Parent, paintEvents);
pevent.Graphics.ResetTransform();
pevent.Graphics.EndContainer(graphicsContainer);
}
protected override void OnPaint(PaintEventArgs pevent)
{
int radius = 5;
SimulateTransparency(pevent);
pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
Color fillColor, textColor;
if (AccessibilityObject.State == AccessibleStates.HotTracked)
{
fillColor = ControlPaint.Light(BackColor);
textColor = ForeColor;
}
else if (AccessibilityObject.State == AccessibleStates.Pressed)
{
fillColor = ControlPaint.Dark(BackColor);
textColor = ForeColor;
}
else if (!Enabled)
{
fillColor = ControlPaint.LightLight(BackColor);
textColor = ControlPaint.Light(ForeColor);
}
else
{
fillColor = BackColor;
textColor = ForeColor;
}
using (var path = RoundedRect(ClientRectangle, radius))
using (var backBrush = new SolidBrush(fillColor))
using (var frontBrush = new SolidBrush(textColor))
{
pevent.Graphics.FillPath(backBrush, path);
pevent.Graphics.DrawString(Text, Font, frontBrush, ClientRectangle, stringFormat);
if (Focused && ShowFocusCues)
{
var rect = ClientRectangle;
rect.Inflate(-radius, -radius);
ControlPaint.DrawFocusRectangle(pevent.Graphics, rect, ForeColor, BackColor);
}
}
}
isHot
variable should do the trick.