ImageEn, unit imageenio

TImageEnIO

Properties · Methods · Events · Demos · Examples

Declaration

TImageEnIO = class(TComponent);


Description

TImageEnIO provides input/output support to ImageEn:
Loading and saving images
Access to image properties and meta-data
Acquisition of images from cameras and scanners
Printing
DirectShow functions for multimedia support

See also: TImageEnMIO, which works with multiple frame images (e.g. animated GIFs)




Generally you will not add a TImageEnIO component directly to your project. It is accessed via the following methods:

1. Using the IO property of a TImageEnView

ImageEnView1.IO.LoadFromFile('C:\MyImage.jpeg');
ImageEnView1.IO.DoPrintPreviewDialog();


2. Using the IO helper property of a TIEBitmap, TBitmap or TImage

// Scan an image and save to file
bmp := TIEBitmap.Create();
if bmp.IO.Acquire() then
  bmp.IO.SaveToFile( 'D:\scan.pdf' );
bmp.Free;


3. Attached to a TIEBitmap or TBitmap in code

// Scan an image and save to file
bmp := TBitmap.Create();
io := TImageEnIO.CreateFromBitmap(bmp);
if io.Acquire() then
  io.SaveToFile( 'D:\scan.pdf' );
io.Free();
bmp.Free();


4. Attached to a TImage

Note: In this case a TImageEnIO would be added to the form and the AttachedTImage set appropriately.

Notes
Ensure you do not call any TImageEnIO methods before it is actually attached to an image container (TImageEnView, TIEBitmap, etc)
For the TImageEnMView component use a TImageEnMIO rather than a TImageEnIO


Demos


Demo Description Demo Project Folder Compiled Demo
Annotations in Meta-Data Add text, lines and highlighting to an image and store them in meta-data InputOutput\Annotations\Annotations.dpr   
Camera Raw Files Loading digital camera raw files using the ielib.dll plug-in InputOutput\CameraRaw\CameraRaw.dpr   
Dicom Viewer Read and animate images of a Dicom file InputOutput\Dicom\Dicom.dpr   
EXIF Editor View and edit EXIF fields from a digital camera files (JPEG, RAW, etc) InputOutput\EXIF\EXIF.dpr   
Image Loading Performance Options to improve loading performance with TImageEnView InputOutput\IEViewPerformance\Performance.dpr   
IPTC Editor View and edit IPTC fields from a JPEG or TIFF image InputOutput\IPTC\IPTC.dpr   
Geo Maps Use the GPS data in photos to show their location on a map InputOutput\GeoMaps\GeoMaps.dpr   
Multi-Page Image Loading Using ImageEnView buttons to navigate the images stored in a multiple-frame file, such as TIFF, GIF, MPEG, PDF, etc. InputOutput\IEViewMulti\IEViewMulti.dpr   
PDF Builder Create PDF and PS files from a selection of images PDF\PDFBuilder\PDFBuilder.dpr   
Preload Images Loading images in the background and displaying as required InputOutput\Preload\Preload.dpr   
Print Selection Print only the selected area of an image InputOutput\PrintSelected\PrintSelected.dpr   
Printing Demo Printing and print preview demo InputOutput\PrintProjects\PrintProjects.dpr   
True Raw Bitmap Format Loading and saving images in a true "Raw" format (Note: this is not the same as camera raw format) InputOutput\RealRAW\RealRAW.dpr   
XMP Meta Data Display common XMP fields from JPEG, TIFF and PSD files InputOutput\XMP\XMP.dpr   
Acquire from Any Source Acquisition from any source: Twain, WIA and connected cameras and cards ImageAcquisition\AllAcquire\AllAcquire.dpr   
All Actions Demo showing all ImageEn actions (400+) available to rapidly build applications Actions\AllActions\AllActions.dpr   

Examples


// Convert a PNG to JPEG at 90% quality
ImageEnView1.IO.LoadFromFile('D:\image.png');
ImageEnView1.IO.Params.JPEG_Quality := 90;
ImageEnView1.IO.SaveToFile('D:\output.jpg');

// Save a TIFF with CMYK
ImageEnView1.IO.LoadFromFile('D:\image.tif');
ImageEnView1.IO.Params.TIFF_PhotometInterpret := ioTIFF_CMYK;
ImageEnView1.IO.SaveToFile('D:\image-cmyk.tif');

// Scan an image at 300dpi
ImageEnView1.IO.AcquireParams.YResolution := 300;
ImageEnView1.IO.AcquireParams.XResolution := 300;
ImageEnView1.IO.Acquire();

// Enable duplexing on the current scanner
ImageEnView1.IO.AcquireParams.DuplexEnabled := True;

// Show advanced GIF saving properties
ImageEnView1.IO.SimplifiedParamsDialogs := False;
ImageEnView1.IO.DoPreviews([ppGIF]);

// Prompt to print the current image
ImageEnView1.IO.DoPrintPreviewDialog( iedtDialog );



Methods and Properties


Connected Component
Public Property  AttachedBitmap
Public Property  AttachedIEBitmap
Published Property  AttachedImageEn
Published Property  AttachedTImage
Public Method  Update

Generic Input/Output
Public Property  Aborting
Public Method  AssignParams
Published Property  AutoAdjustDPI
Published Property  Background
Public Property  Bitmap
Public Method  CaptureFromScreen
Public Property  ChangeBackground
Public Method  Create
Public Method  CreateFromBitmap
Public Property  DefaultDitherMethod
Published Property  FilteredAdjustDPI
Public Property  IEBitmap
Public Method  LoadFromBuffer
Public Method  LoadFromFileAuto
Public Method  LoadFromFile
Public Method  LoadFromResource
Public Method  LoadFromStream
Public Method  LoadFromText
Public Method  LoadFromURL
Published Property  NativePixelFormat
Public Property  Params
Public Method  ParamsFromBuffer
Public Method  ParamsFromFile
Public Method  ParamsFromStream
Public Property  ProgressTask
Public Method  SaveToFile
Public Method  SaveToStream
Public Method  SaveToText
Public Method  Seek
Published Property  StreamHeaders
Public Property  WicFastLoading

Image Acquisition (Twain/WIA)
Public Method  Acquire
Public Method  SelectAcquireSource
Public Property  SelectedAcquireSource
Public Method  SetAcquireSource
Public Property  AcquireParams
Public Property  DCIMParams
Public Property  TwainParams
Public Method  TwainAcquireOpen
Public Method  TwainAcquireClose
Public Property  WIAParams

Aynchronous Input/Output
Public Property  AsyncMode
Public Property  AsyncRunning
Public Property  ThreadsCount
Public Method  WaitThreads

Video Capture
Public Property  DShowParams
Public Property  MediaFoundationSourceReader

Dialogs
Public Method  DoPreviews
Public Method  ExecuteOpenDialog
Public Method  ExecuteSaveDialog
Published Property  PreviewFont
Published Property  PreviewFontEnabled
Published Property  PreviewsParams
Published Property  SimplifiedParamsDialogs

Printing
Public Method  DoPrintPreviewDialog
Public Method  PreviewPrintImage
Public Method  PrintImagePos
Public Method  PrintImage
Public Property  PrintingFilterOnSubsampling
Public Property  PrintingMaintainAR
Public Property  PrintPreviewParams


Format-Specific Methods

Adobe PDF
Public Method  ClosePDFFile
Public Method  CreatePDFFile
Public Method  LoadFromFilePDF
Public Method  LoadFromStreamPDF
Public Method  SaveToFilePDF
Public Method  SaveToPDF
Public Method  SaveToStreamPDF

Adobe PSD
Public Method  LoadFromFilePSD
Public Method  LoadFromStreamPSD
Public Method  SaveToFilePSD
Public Method  SaveToStreamPSD

AVI Videos
Public Method  CloseAVIFile
Public Method  CreateAVIFile
Public Method  IsOpenAVI
Public Method  LoadFromAVI
Public Method  OpenAVIFile
Public Method  SaveToAVI

BMP
Public Method  LoadFromFileBMP
Public Method  LoadFromStreamBMP
Public Method  SaveToFileBMP
Public Method  SaveToStreamBMP

BmpRaw (a true "raw" bitmap format, not a camera Raw file)
Public Method  LoadFromFileBMPRAW
Public Method  LoadFromStreamBMPRAW
Public Method  SaveToFileBMPRAW
Public Method  SaveToStreamBMPRAW

Camera Raw Files
Public Method  LoadFromFileRAW
Public Method  LoadFromStreamRAW
Public Method  LoadJpegFromFileCRW

Cursors (CUR)
Public Method  LoadFromFileCUR
Public Method  LoadFromStreamCUR

DICOM Medical Imaging Format
Public Method  InjectDICOMTags
Public Method  LoadFromFileDICOM
Public Method  LoadFromStreamDICOM
Public Method  SaveToFileDICOM
Public Method  SaveToStreamDICOM

GIF
Published Property  GIFFrameCaching
Public Method  InsertToFileGIF
Public Method  LoadFromFileGIF
Public Method  LoadFromStreamGIF
Public Method  SaveToFileGIF
Public Method  SaveToStreamGIF
Public Method  ReplaceFileGIF

Icons (ICO)
Public Method  LoadFromFileICO
Public Method  LoadFromStreamICO
Public Method  SaveToFileICO
Public Method  SaveToStreamICO

IEN (ImageEn native image format with layers)
Public Method  LoadFromFileIEN
Public Method  LoadFromStreamIEN
Public Method  SaveToFileIEN
Public Method  SaveToStreamIEN

JPEG
Public Method  InjectJpegEXIF
Public Method  InjectJpegIPTC
Public Method  LoadFromFileJpeg
Public Method  LoadFromStreamJpeg
Public Method  SaveToFileJpeg
Public Method  SaveToStreamJpeg

JPEG 2000
Public Method  LoadFromFileJ2K
Public Method  LoadFromFileJP2
Public Method  LoadFromStreamJ2K
Public Method  LoadFromStreamJP2
Public Method  SaveToFileJ2K
Public Method  SaveToFileJP2
Public Method  SaveToStreamJ2K
Public Method  SaveToStreamJP2

Media Files (AVI, MPEG, WMV..)
Public Method  CloseMediaFile
Public Method  IsOpenMediaFile
Public Method  LoadFromMediaFile
Public Method  OpenMediaFile

Meta Files (WMF, EMF)
Public Method  ImportMetafile
Public Method  MergeMetaFile

Microsoft HD Photos/JPEG XR (WDP/JXR/HDP)
Public Method  LoadFromFileHDP
Public Method  LoadFromStreamHDP
Public Method  SaveToFileHDP
Public Method  SaveToStreamHDP

PCX and DCX (Multipage PCX)
Public Method  LoadFromFileDCX
Public Method  LoadFromStreamDCX
Public Method  LoadFromFilePCX
Public Method  LoadFromStreamPCX
Public Method  SaveToStreamDCX
Public Method  SaveToFileDCX
Public Method  InsertToFileDCX
Public Method  SaveToFilePCX
Public Method  SaveToStreamPCX

PNG
Public Method  LoadFromFilePNG
Public Method  LoadFromStreamPNG
Public Method  SaveToFilePNG
Public Method  SaveToStreamPNG

PostScript (PS)
Public Method  ClosePSFile
Public Method  CreatePSFile
Public Method  SaveToFilePS
Public Method  SaveToPS
Public Method  SaveToStreamPS

PXM (PPM, PBM, PGM)
Public Method  LoadFromFilePXM
Public Method  LoadFromStreamPXM
Public Method  SaveToFilePXM
Public Method  SaveToStreamPXM

SVG (Scalable Vector Graphics)
Public Method  ImportFromFileSVG
Public Method  ImportFromStreamSVG
Public Method  SaveToFileSVG
Public Method  SaveToStreamSVG

Targa (TGA)
Public Method  LoadFromFileTGA
Public Method  LoadFromStreamTGA
Public Method  SaveToFileTGA
Public Method  SaveToStreamTGA

TIFF
Public Method  InjectTIFFEXIF
Public Method  InsertToFileTIFF
Public Method  InsertToStreamTIFF
Public Method  LoadFromFileTIFF
Public Method  LoadFromStreamTIFF
Public Method  ReplaceFileTIFF
Public Method  ReplaceStreamTIFF
Public Method  SaveToFileTIFF
Public Method  SaveToStreamTIFF

WebP
Public Method  LoadFromFileWebP
Public Method  LoadFromStreamWebP
Public Method  SaveToFileWebP
Public Method  SaveToStreamWebP

WBMP
Public Method  LoadFromFileWBMP
Public Method  LoadFromStreamWBMP
Public Method  SaveToFileWBMP
Public Method  SaveToStreamWBMP

WIC Plug-In Formats (such as HEIF/HEIC, DirectDraw Surface, etc)
Public Method  LoadFromFileWIC
Public Method  LoadFromStreamWIC
Public Method  SaveToFileWIC
Public Method  SaveToStreamWIC

ZIP
Public Method  ExtractFromFileZIP (Requires Plug-In)
Public Method  ExtractFromStreamZIP (Requires Plug-In)
Public Method  LoadFromFileZIP (Requires Plug-In)
Public Method  LoadFromStreamZIP (Requires Plug-In)

Events
Event  OnAcquireBitmap
Event  OnAcquireClose
Event  OnDoPreviews
Event  OnFinishWork
Event  OnIOPreview
Event  OnPrintPage
Event  OnProgress