ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Version 7 IERegisterFormats
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Apr 30 2017 :  18:06:16  Show Profile  Reply
IERegisterFormats does not add TIENativeImage

{Register/unregister following classes inside the VCL class framework. This allows use of standard VCL open/save dialogs and TPicture objects with ImageEn file formats.}
IERegisterFormats;
{ Set the file dialogs filters }
OpenPictureDialog1.Filter := GraphicFilter(TGraphic);

Please add TIENativeImage and TPicture.RegisterFileFormat('IEN', 'ImageEn Native Format', TIENativeImage) to the IERegisterFormats method and TPicture.UnregisterGraphicClass(TIENativeImage) to IEUnregisterFormats method
in the iexBitmaps Unit:
// TIEMultiBitmap
///////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
  TIETIFFImage = class(TIEGraphicBase)
  end;
  TIEGIFImage = class(TIEGraphicBase)
  end;
  TIEJpegImage = class(TIEGraphicBase)
  end;
  TIEPCXImage = class(TIEGraphicBase)
  end;
  TIEBMPImage = class(TIEGraphicBase)
  end;
  TIENativeImage = class(TIEGraphicBase) << Add >>
  end;
  TIEICOImage = class(TIEGraphicBase)
  end;

procedure IERegisterFormats;
begin
  TPicture.RegisterFileFormat('TIF', 'TIFF Image', TIETIFFImage);
  TPicture.RegisterFileFormat('TIFF', 'TIFF Image', TIETIFFImage);
  TPicture.RegisterFileFormat('FAX', 'TIFF Image', TIETIFFImage);
  TPicture.RegisterFileFormat('G3N', 'TIFF Image', TIETIFFImage);
  TPicture.RegisterFileFormat('G3F', 'TIFF Image', TIETIFFImage);

  TPicture.RegisterFileFormat('GIF', 'GIF Image', TIEGIFImage);

  TPicture.RegisterFileFormat('JPG', 'JPEG Image', TIEJpegImage);
  TPicture.RegisterFileFormat('JPEG', 'JPEG Image', TIEJpegImage);
  TPicture.RegisterFileFormat('JPE', 'JPEG Image', TIEJpegImage);

  TPicture.RegisterFileFormat('PCX', 'PaintBrush', TIEPCXImage);

  // BMP extension disabled to avoid conflicts with VCL version
  //TPicture.RegisterFileFormat('BMP', 'Windows Bitmap', TIEBMPImage);
  TPicture.RegisterFileFormat('DIB', 'Windows Bitmap', TIEBMPImage);
  TPicture.RegisterFileFormat('RLE', 'Windows Bitmap', TIEBMPImage);

  // ICO is disabled to avoid conflicts with VCL version
//TPicture.RegisterFileFormat('ICO', 'Windows Icon', TIEICOImage);

{$IFDEF IEINCLUDEPNG}
  TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TIEPNGImage);
{$ENDIF}

  TPicture.RegisterFileFormat('TGA', 'Targa Image', TIETGAImage);
  TPicture.RegisterFileFormat('TARGA', 'Targa Image', TIETGAImage);
  TPicture.RegisterFileFormat('VDA', 'Targa Image', TIETGAImage);
  TPicture.RegisterFileFormat('ICB', 'Targa Image', TIETGAImage);
  TPicture.RegisterFileFormat('VST', 'Targa Image', TIETGAImage);
  TPicture.RegisterFileFormat('PIX', 'Targa Image', TIETGAImage);

  TPicture.RegisterFileFormat('PXM', 'Portable Pixmap, Greymap, Bitmap', TIEPXMImage);
  TPicture.RegisterFileFormat('PPM', 'Portable Pixmap, Greymap, Bitmap', TIEPXMImage);
  TPicture.RegisterFileFormat('PGM', 'Portable Pixmap, Greymap, Bitmap', TIEPXMImage);
  TPicture.RegisterFileFormat('PBM', 'Portable Pixmap, Greymap, Bitmap', TIEPXMImage);

{$IFDEF IEINCLUDEJPEG2000}
  TPicture.RegisterFileFormat('JP2', 'JPEG2000', TIEJP2Image);
  TPicture.RegisterFileFormat('J2K', 'JPEG2000 Code Stream', TIEJ2KImage);
  TPicture.RegisterFileFormat('JPC', 'JPEG2000 Code Stream', TIEJ2KImage);
  TPicture.RegisterFileFormat('J2C', 'JPEG2000 Code Stream', TIEJ2KImage);
{$ENDIF}

  TPicture.RegisterFileFormat('PSD', 'Adobe PSD', TIEPSDImage);
  TPicture.RegisterFileFormat('IEN', 'ImageEn Native Format', TIENativeImage); << Add >>
end;

procedure IEUnregisterFormats;
begin
  try
    TPicture.UnregisterGraphicClass(TIETIFFImage);
    TPicture.UnregisterGraphicClass(TIEGIFImage);
    TPicture.UnregisterGraphicClass(TIEJpegImage);
    TPicture.UnregisterGraphicClass(TIEPCXImage);
    TPicture.UnregisterGraphicClass(TIEBMPImage);
    //TPicture.UnregisterGraphicClass(TIEICOImage); // ICO is disabled to avoid conflicts with VCL version
    {$ifdef IEINCLUDEPNG}
    TPicture.UnregisterGraphicClass(TIEPNGImage);
    {$endif}
    TPicture.UnregisterGraphicClass(TIETGAImage);
    TPicture.UnregisterGraphicClass(TIEPXMImage);
    {$ifdef IEINCLUDEJPEG2000}
    TPicture.UnregisterGraphicClass(TIEJP2Image);
    TPicture.UnregisterGraphicClass(TIEJ2KImage);
    {$endif}
    TPicture.UnregisterGraphicClass(TIEPSDImage);
    TPicture.UnregisterGraphicClass(TIENativeImage); << Add >>
  except
  end;
end;


Also add to IEInitFileFormats so the extension is initialized so it appears in ALL...
procedure IEInitFileFormats;
...
 // ImageEn Native File Format << Add >>
  fi := TIEFileFormatInfo.Create;
  with fi do
  begin
    FileType := ioIEN;
    FullName := 'ImageEn Native File Format';
    Extensions := 'IEN';
    SuitableExtension := 'ien';
    DialogPage := [];
    ReadFunction := nil;
    WriteFunction := DumpWriteImageStream;
    TryFunction := DumpTryimageStream;
    InternalFormat := True;
    IEFileFormatAdd(fi);
  end;
...
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

38610 Posts

Posted - Apr 30 2017 :  20:39:02  Show Profile  Reply
Thanks, I've added TImage support for IEN in the current Git version.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: