/// <summary> /// Accessor to false color coded palette image /// </summary> /// <returns>RGB palette image</returns> /// /// <exception cref="System.Exception">Thrown on error</exception> public Bitmap GetPaletteImage() { CheckConnectionState(); int width, height; CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_palette_image_size(out width, out height)); Bitmap image = new Bitmap(width, height, PixelFormat.Format24bppRgb); BitmapData bmpData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.WriteOnly, image.PixelFormat); CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_palette_image(out width, out height, bmpData.Scan0)); image.UnlockBits(bmpData); return(image); }
/// <summary> /// Accessor to false color coded palette image and thermal image from same frame /// </summary> /// <returns cref="ThermalPaletteImage">False color coded palette and thermal image</returns> /// <exception cref="System.Exception">Thrown on error</exception> public ThermalPaletteImage GetThermalPaletteImage() { CheckConnectionState(); int paletteWidth, paletteHeight; int thermalWidth, thermalHeight; CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_palette_image_size(out paletteWidth, out paletteHeight)); CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_thermal_image_size(out thermalWidth, out thermalHeight)); Bitmap paletteImage = new Bitmap(paletteWidth, paletteHeight, PixelFormat.Format24bppRgb); ushort[,] thermalImage = new ushort[thermalHeight, thermalWidth]; BitmapData bmpData = paletteImage.LockBits(new Rectangle(0, 0, paletteImage.Width, paletteImage.Height), ImageLockMode.WriteOnly, paletteImage.PixelFormat); CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_thermal_palette_image( thermalWidth, thermalHeight, thermalImage, paletteImage.Width, paletteImage.Height, bmpData.Scan0)); paletteImage.UnlockBits(bmpData); return(new ThermalPaletteImage(thermalImage, paletteImage)); }