ShiftOS-C-/source/WindowsFormsApplication1/Controls/ImageSelector.cs
MichaelTheShifter 6b804f03eb Full ShiftUI conversion
The only bugs are that windows don't show in the center of the screen,
and Gecko webbrowsers are not serializing properly to be converted to
ShiftUI widgets (you can use the ToWidget() extension method to convert
a WinForms control to a ShiftUI widget)

Also multiple desktop panels are removed due to some odd bug I can't
diagnose. Will add them back in the future. Promise. I loved creating
GNOME2 skins.
2016-07-19 21:53:26 -04:00

55 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShiftUI;
using System.IO;
namespace ShiftOS
{
public partial class ImageSelector : UserWidget
{
public ImageSelector()
{
InitializeComponent();
}
public Image Image
{
get
{
return btnselect.BackgroundImage;
}
}
private string _ImagePath = null;
public string ImagePath
{
get
{
return _ImagePath;
}
}
private void btnselect_Click(object sender, EventArgs e)
{
API.CreateFileSkimmerSession(".pic;.png;.jpg;.bmp", File_Skimmer.FileSkimmerMode.Open);
API.FileSkimmerSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
var res = API.GetFSResult();
if(res != "fail")
{
var finf = new FileInfo(res);
_ImagePath = finf.Name;
btnselect.BackgroundImage = Image.FromFile(res);
btnselect.BackgroundImageLayout = ImageLayout.Center;
}
};
}
}
}