TJPEGImage component version 1.3 Luciano Bajo Eloy - Sep 9, 1997
Madrid, Spain
E-mail: lbe20@tid.es
Andreas Hoerstemeier - May 17, 1998
Aachen, Germany
E-Mail: andy@hoerstemeier.de
WWW: http://www.westend.de/~hoerstemeier
-------------------------------------------------------------------------------
Note on Version 1.3: This version now adds the ability to save the JPEG
as well as a TDBJPEGImage. For details see the
New Features section.
-------------------------------------------------------------------------------
Important note: I (Luciano) have changed my job. I do not work with Delphi
currently, I use Visual C++ (I hate it, but such is life).
That means that I cannot reply several mails a day pertaining
to TJPEGImage. Instead I have included the source code. If
you have any problems, you will have to modify the code by
yourself. Please, do not send me E-mails unless it is truly
necessary.
Note on installation: Select the file JpgImgR.pas when installing the component
-------------------------------------------------------------------------------
Index:
0. Answers to common questions and requests
1. New features (from version 1.0 to 1.1 and 1.2)
2. Introduction
3. JPEGImage properties and events
3a. DBJPEGImage additional properties and events
4. Remarkable features
5. Known limitations (future improvements?)
6. Distribution and source code
7. Information and libraries on JPEG compression
-------------------------------------------------------------------------------
0. Answers to common questions and requests
-------------------------------------------------------------------------------
Basically, all of the E-mails I have received pertaining to TJPEGImage
fall into one of these topics:
-Requests for source code. Well, I did not provide the source code
with TJPEGImage 1.0 (I sended it on request) as a mean to know if the
component was being used. The result is that many people have requested it
and I have had to send several mails a day with the code attached. To avoid
this, I provide the full source code with this version.
-Support for Delphi 3.0. Delphi 3.0 adds support for JPEG files so
TJPEGImage is no longer required. Drop a TImage on a form (Image1, for
example), add jpeg.pas to the uses clause and load a JPEG file with
Image1.Picture.LoadFromFile. However this component also runs with D3 since
V1.2, only a bit slower than the Delphi one.
-Loading pictures from a stream. TJPEGImage does not support loading
pictures from a stream. If you need that feature you will have to modify
the code, I think it will not be difficult. (Obsolete, added with V1.2)
-Coding JPEG images. TJPEGImage is a decoder, not a coder. That means
that you can view JPEG files, but you cannot save files as JPEG. (Obsolete,
added with V1.3).
-------------------------------------------------------------------------------
1. New features (from version 1.0 to 1.1 and 1.2)
-------------------------------------------------------------------------------
From Version 1.0 to 1.1
-Finally, FileName has its own property editor by courtesy of Keith
Anderson, who sent me the code by E-mail.
-A new property and a new event have been added for indicating the
progress of the decompression (see section 2 for details).
-A bug has been fixed. When a corrupted JPEG file was loaded into
the component the file was being left open. Any further action on this file
generated a Sharing Violation exception (IOResult = 32). The bug has been
reported and fixed by Derek (sorry, I do not know your last name).
From Version 1.1 to 1.2 (changes done by Andreas Hoerstemeier)
-The component can now also load the image from any stream, it now has
a LoadFromStream method, so it can also be used to display files out of a
database (TBlobStream) or downloaded from the web without the need of a
temporary file.
-As the whole PasJPG library didn't include any 32bit specific parts
the component could be modified easily for Delphi 1 (but note it is slow there
compared to Delphi 2), and in the same way to work with Delphi 3, too. It may
also run in C++ Builder, but I've no chance of testing this.
From version 1.2 to 1.3 (changes done by Andreas Hoerstemeier)
-The coding part of the JPEG library is now also included and
connected to the component.
-A new TDBJPEGImage is included which allows to you to link a BLOB
field containing JPEG images to a visual control easily.
From version 1.3 to 1.4 (changes done by Andreas Hoerstemeier)
-New property Comment to link to the optional comment within the
JPEG file.
-------------------------------------------------------------------------------
2. Introduction
-------------------------------------------------------------------------------
JPEGImage is based on the work of NOMSSI NZALI Jacques H. C., author
of the PASJPEG library (http://www.tu-chemnitz.de/~nomssi/pub/pasjpeg.zip).
On his own words, PASJPEG is a port of the sixth public release of the IJG
(Independent JPEG Group) C source (release 6a of 7-Feb-96), that implements
JPEG baseline, extended-sequential, and progressive compression processes to
Turbo Pascal 7.0 for DOS (TP).
My goal was to get a Delphi component for decompressing and viewing
JPEG images. So I began from DJPEG.PAS, a DOS program written by Thomas G.
Lane included in the PASJPEG library for translating JPEG files to BMP or
TARGA files. My work has consisted of the following steps:
1. Create a new component inherited from TImage.
2. Change command line options in DJPEG to properties in TJPEGImage.
3. Fit the output in a memory stream instead of a disk file.
4. Change WriteLn and Halt procedures to Delphi exceptions.
5. Put the library on a diet, that is, delete unnecessary files and
code.
Once those steps where covered, I found a problem in 256 colors video
mode: the first image loaded had the right colors, but successive images
caused the color palette to become corrupted. Fortunately, I was a little
luck and I could solve the problem.
-------------------------------------------------------------------------------
3. JPEGImage properties and events
-------------------------------------------------------------------------------
The properties of TJPEGImage are (apart from those in TImage):
-FileName: Name of the JPEG file.
-NumOfColors: Colors of the resulting image. Possible values are _16,
_256, or TrueColor. DO NOT use TrueColor in 256 video modes or
the colors in the image will become distorted. (Default 256).
Not used for saving as JPEG images can only be true color or
grayscale.
-DCTMethod: Method used for the Discrete Cosine Transform in JPEG
algorithms. Possible values are Integ (default), FastInteg
(faster but less accurate) or FloatingPoint (more accurate
but slower).
-Dither: Possible values are none (do not use dithering in
quantization), FS (default) or ordered (medium speed, quality).
Not for saving.
-GrayScale: Force grayscale output (default False).
-NoSmooth: Do not use high-quality upsampling (default False).
Loading only.
yxkfw
- 粉丝: 82
- 资源: 2万+
最新资源
- 3e53940d22a0327bf2fe77db43da8529 (1).png
- 基于小程序的傣族节日及民间故事推广小程序源码(小程序毕业设计完整源码+LW).zip
- 基于Java多语言开发的小程序商城系统设计源码
- 基于Vue框架的排课项目前端设计源码
- 基于的学生宿舍管理系统+node源码(小程序毕业设计完整源码).zip
- 基于指纹识别技术的社区矫正人员管理平台设计源码
- 基于Java的选课管理系统GUI设计源码
- 基于C#开发的医院病人出入院管理系统设计源码
- 基于小程序的农产品商城小程序源码(小程序毕业设计完整源码).zip
- 集冲模、装配和检测于一体的装配机sw19可编辑全套技术资料100%好用.zip
- 基于小程序的“健康早知道”源码(小程序毕业设计完整源码+LW).zip
- 基于HUST2024软件工程项目的儿童学习系统CSS设计源码
- 基于光电心率检测技术的Heartrate设计源码
- 基于小程序的“口腔助手”小程序的设计与实现源码(小程序毕业设计完整源码+LW).zip
- 基于PHP的简单轻巧灵活工作流引擎设计源码
- 流水线风干机sw18可编辑全套技术资料100%好用.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈