📄 pcxfilter.pas
字号:
(*
Copyright (c) 1998-2007 by HiComponents. All rights reserved.
This software comes without express or implied warranty.
In no case shall the author be liable for any damage or unwanted behavior of any
computer hardware and/or software.
HiComponents grants you the right to include the compiled component
in your application, whether COMMERCIAL, SHAREWARE, or FREEWARE,
BUT YOU MAY NOT DISTRIBUTE THIS SOURCE CODE OR ITS COMPILED .DCU IN ANY FORM.
ImageEn, IEvolution and ImageEn ActiveX may not be included in any commercial,
shareware or freeware libraries or components.
email: support@hicomponents.com
http://www.hicomponents.com
*)
unit pcxfilter;
{$R-}
{$Q-}
{$I ie.inc}
interface
uses Windows, Graphics, classes, sysutils, ImageEnProc, ImageEnIO, hyiedefs, hyieutils;
type
TPcxHeader = packed record // Header di un file PCX
Manufacturer: Byte;
Version: Byte;
Encoding: Byte;
Bits_Per_Pixel: Byte;
Xmin, Ymin: Word;
Xmax, Ymax: Word;
Hres, Vres: Word;
Palette: array[0..15] of TRGB;
Reserved: Byte;
Colour_Planes: Byte;
Bytes_Per_Line: Word;
Palette_Type: Word; // 0=256colori/true_color
Filler: array[0..57] of Byte;
end;
procedure ReadPcx(nf: string; Bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec);
procedure ReadPcxStream(fs: TStream; Bitmap: TIEBitmap; var IOParams: TIOParamsVals; fsDim: integer; var Progress: TProgressRec; Preview: boolean);
procedure WritePcx(nf: string; bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec);
procedure WritePcxStream(fs: TStream; bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec);
procedure IEDCXReadStream(fs: TStream; Bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec; Preview: boolean);
procedure IEDCXInsertStream(fs: TStream; bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec);
procedure IEDCXDeleteStream(fs:TStream; idx:integer);
function IEDCXCountStream(fs:TStream):integer;
function IEDCXTryStream(fs:TStream):boolean;
implementation
uses ImageEnView, NeurQuant, ieview;
{$R-}
/////////////////////////////////////////////////////////////////////////////////////
// Legge il file PCX specificato e restitisce una bitmap contenente l'immagine.
// nf = nome del file pcx
procedure ReadPcx(nf: string; Bitmap: TIEBitmap; var IOParams: TIOParamsVals; var Progress: TProgressRec);
var
fs: TFileStream;
begin
fs := nil;
try
fs := TFileStream.create(nf, fmOpenRead or fmShareDenyWrite);
ReadPcxStream(fs, Bitmap, IOParams, fs.size, Progress, false);
finally
FreeAndNil(fs);
end;
end;
/////////////////////////////////////////////////////////////////////////////////////
// Legge il stream PCX specificato e restitisce una bitmap contenente l'immagine.
// nf = nome del file pcx
// fsDim = dimensione del blocco pcx (necessario perch
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -