Coder Social home page Coder Social logo

voidziad / winblur Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 2.0 2.24 MB

WinBlur is a C#, VB .NET Library that allows developers to use modern blur types on their forms.

License: MIT License

C# 100.00%
blur dotnet effect windows winforms acrylic mica tabbed

winblur's Introduction

ipiccy_image (2)

๐ŸชŸ WinBlur (Windows 10 & Above)

WinBlur is a C#, VB .NET Library that allows developers to use modern blur types on their forms.

Getting Started: 3 easy steps to use WinBlur.

  • Step 1. Install WinBlur from NuGET.
Install-Package WinBlur
  • Step 2. Head over to your form, and import the packages needed.
using WinBlur;
using static WinBlur.UI;
  • Step 3. A) If you are not using the None FormBorderStyle, then create the Form_Load event, or head over to the form constructor and add the following code:
// cntrl: The form/control you are targetting.
// blurType: The blur type for the form/control.
// designMode: The design mode (or style) for the form/control.

// this.BackColor = Color.Black;
// The code on top is recommended, but is not necessary.
// In case the code below doesn't work by itself, please change the control/form BackColor to Black/White.

SetBlurStyle(frm: this, blurType: BlurType.Acrylic, designMode: Mode.DarkMode, showWindowsTitle: true);
  • Step 3. B) If you are using the None FormBorderStyle, then create the Form_Load event, or head over to the form constructor and add the following code:
// cntrl: The form/control you are targetting.
// blurType: The blur type for the form/control.
// designMode: The design mode (or style) for the form/control.

// this.BackColor = Color.Black;
// The code on top is recommended, but is not necessary.
// In case the code below doesn't work by itself, please change the control/form BackColor to Black/White.

SetBlurStyle(frm: this, blurType: BlurType.Acrylic, designMode: Mode.DarkMode, showWindowsTitle: false);
  • โš ๏ธWARNING: If you are using the None FormBorderStyle, then create the Form_Shown event instead, and add the same code that is shown on top of this text.

  • ๐Ÿ“NOTE: Using WinBlur on Controls is currently most likely not going to work, so this mainly just supports Forms right now.

For DarkMode, please set your Form.BackColor to a Dark color, preferrably Color.Black.
For LightMode, please set your Form.BackColor to a Light color/White color, preferrably Color.White.

There you have it! Your project now supports & uses WinBlur.

image

Open Source

This project is open-source, and free to use commercially & personally. I would not like any credit for this, enjoy using it.
If you want to contribute, feel free to make a pull request and merge it.

winblur's People

Contributors

voidziad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rly0nheart

winblur's Issues

Mica/Acryl does not work, even on Windows 11

image
I just get a black window background. This is a newly created WinForms app with one button in the middle.
Here is my Form1 code, everything else is the default. Mica is enabled in my Windows 11 system.

    public partial class Form1 : Form
	{
		
		public Form1()
        {
            InitializeComponent();
            this.Load += new EventHandler(Form1_Load);
		}

		private void button1_Click(object sender, EventArgs e)
		{
			MessageBox.Show("Witti.exe", "Moin Mica!");
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			this.BackColor = Color.Black;
			UI.SetBlurStyle(cntrl: this, blurType: UI.BlurType.Mica, designMode: UI.Mode.DarkMode);
		}
	}

No Blur

Hi,

i'm not sure if I am missing something, but my form is only transparent. There is no blur at all.

My FormBorderStyle is set to None
This is the code I tested with:

using System;
using System.Drawing;
using System.Windows.Forms;
using WinBlur;
using static WinBlur.UI;

namespace WindowsFormsApp2
{
    public partial class Popup : Form
    {

        public Popup()
        {
            InitializeComponent();
            this.BackColor = Color.Black;
            SetBlurStyle(cntrl: this, blurType: BlurType.Acrylic, designMode: Mode.DarkMode);
        }

        private void Popup_Load(object sender, EventArgs e)
        {

        }
    }
}

The X in the middle is from the popup form, which should be transparent and blurred.
image

Presenting Problems and Suggestions

Hello, I found quite interesting the work... I searched a lot for a solution that would allow me to create fluent interfaces, with Acrylic or Mica style, and I didn't find good material and anywhere... I found his project and enjoyed it a lot, because it almost solved my problem.
Problem:
Unfortunately, when testing it, he modified the control as intended, but damaged the design of the controls that constitute it. The text of the buttons looked strange, and the colors of the text, whether of buttons or labels, became blurry and weird... Already the text of the textbox, does not appreciate more ...

Suggest:
I would like to suggest that the same blurring mechanism be implemented for the controls as well, ex
SetBlurStyle(panel1, BlurType.Acrylic, Mode.LightMode);
where the backdroop will be an image that put as a backround of its containment element

Light Mode cannot display a matching Fore Color.

The light mode works very buggy for me. The fore color of objects (labels, picture box and much more) cannot be changed further in light mode. I can't adapt to myself. I am using Visual Basic WinForms Net 4.8

Screenshot 2023-03-29 140410

Screenshot 2023-03-29 140421

`
Imports WinBlur
Imports WinBlur.UI
Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.BackColor = Color.Black
    Me.ForeColor = Color.White
    SetBlurStyle(Me, BlurType.Mica, Mode.DarkMode)
    Me.BackColor = Color.Black
    Me.ForeColor = Color.White
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.BackColor = Color.White
    SetBlurStyle(Me, BlurType.Mica, Mode.LightMode)
    Me.BackColor = Color.White
    Me.ForeColor = Color.DimGray
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.BackColor = Color.Black
    Me.ForeColor = Color.White
    SetBlurStyle(Me, BlurType.Mica, Mode.DarkMode)
    Me.BackColor = Color.Black
    Me.ForeColor = Color.White
End Sub

End Class
`
Mica Test.zip

No longer working?

I've tried implementing this in to a app just to test it and it doesn't seem to be working the form just turns completely black or white depending on the mode

image

Windwos 10 fฤฑx

Is it not possible to use Win 10 for this project at all? I would appreciate it if you could provide feedback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.