/// <summary> /// Accessor to thermal image. /// Conversion to temperature values are to be performed as follows: /// t = ((double)data[row,column] - 1000.0) / 10.0 /// </summary> /// <returns>Thermal Image as ushort[height, width]</returns> /// <exception cref="System.Exception">Thrown on error</exception> public ushort[,] GetThermalImage() { CheckConnectionState(); int width, height; CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_thermal_image_size(out width, out height)); ushort[,] buffer = new ushort[height, width]; CheckResult(IrDirectInterfaceInvoke.evo_irimager_get_thermal_image(out width, out height, buffer)); return(buffer); }
/// <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)); }