public void LoadImage(Bitmap picBoxImg, ImageEditorBase editor) { imageEditor = editor; //Resize texture to hopefully prevent slow loading var image = BitmapExtension.Resize(picBoxImg, 65, 65); imgList.Images.Clear(); imgList.ImageSize = new Size(65, 65); imgList.ColorDepth = ColorDepth.Depth32Bit; Thread Thread = new Thread((ThreadStart)(() => { LoadImage(image); Bitmap red = BitmapExtension.ShowChannel(new Bitmap(image), STChannelType.Red); LoadImage(red); Bitmap green = BitmapExtension.ShowChannel(new Bitmap(image), STChannelType.Green); LoadImage(green); Bitmap blue = BitmapExtension.ShowChannel(new Bitmap(image), STChannelType.Blue); LoadImage(blue); Bitmap alpha = BitmapExtension.ShowChannel(new Bitmap(image), STChannelType.Alpha); LoadImage(alpha); red.Dispose(); green.Dispose(); blue.Dispose(); alpha.Dispose(); })); Thread.Start(); channelListView.FullRowSelect = true; channelListView.SmallImageList = imgList; }
private Bitmap SetChannel(Bitmap image, int ChannelIndex) { if (ChannelIndex == 0) { return(image); } else if (ChannelIndex == 1) { return(BitmapExtension.ShowChannel(image, STChannelType.Red)); } else if (ChannelIndex == 2) { return(BitmapExtension.ShowChannel(image, STChannelType.Green)); } else if (ChannelIndex == 3) { return(BitmapExtension.ShowChannel(image, STChannelType.Blue)); } else { return(BitmapExtension.ShowChannel(image, STChannelType.Alpha)); } }