亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pngimage.pas

?? New tj source www.opensc.ws - trojan source codes.
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
{Portable Network Graphics Delphi 1.432   (24 August 2002)    }

{This is the latest implementation for TPngImage component    }
{It's meant to be a full replacement for the previous one.    }
{There are lots of new improvements, including cleaner code,  }
{full partial transparency support, speed improvements,       }
{saving using ADAM 7 interlacing, better error handling, also }
{the best compression for the final image ever. And now it's  }
{truly able to read about any png image.                      }

{
  Version 1.432
  2002-08-24 - * NEW *  A new method, CreateAlpha will transform the
               current image into partial transparency.
               Help file updated with a new article on how to handle
               partial transparency.

  Version 1.431
  2002-08-14 - Fixed and tested to work on:
               C++ Builder 3
               C++ Builder 5
               Delphi 3
               There was an error when setting TransparentColor, fixed
               New method, RemoveTransparency to remove image
               BIT TRANSPARENCY

  Version 1.43
  2002-08-01 - * NEW * Support for Delphi 3 and C++ Builder 3
               Implements mostly some things that were missing,
               a few tweaks and fixes.
               
  Version 1.428
  2002-07-24 - More minor fixes (thanks to Ian Boyd)
               Bit transparency fixes
               * NEW * Finally support to bit transparency
               (palette / rgb / grayscale -> all)

  Version 1.427
  2002-07-19 - Lots of bugs and leaks fixed
               * NEW * method to easy adding text comments, AddtEXt
               * NEW * property for setting bit transparency,
                       TransparentColor

  Version 1.426
  2002-07-18 - Clipboard finally fixed (hope)
               Changed UseDelphi trigger to UseDelphi
               * NEW * Support for bit transparency bitmaps
                       when assigning from/to TBitmap objects
               Altough it does not support drawing transparent
               parts of bit transparency pngs (only partial)
               it is closer than ever

  Version 1.425
  2002-07-01 - Clipboard methods implemented
               Lots of bugs fixed

  Version 1.424
  2002-05-16 - Scanline and AlphaScanline are now working correctly.
               New methods for handling the clipboard

  Version 1.423
  2002-05-16 - * NEW * Partial transparency for 1, 2, 4 and 8 bits is
               also supported using the tRNS chunk (for palette and
               grayscaling).
               New bug fixes (Peter Haas).

  Version 1.422
  2002-05-14 - Fixed some critical leaks, thanks to Peter Haas tips.
               New translation for German (Peter Haas).

  Version 1.421
  2002-05-06 - Now uses new ZLIB version, 1.1.4 with some security
               fixes.
               LoadFromResourceID and LoadFromResourceName added and
               help file updated for that.
               The resources strings are now located in pnglang.pas.
               New translation for Brazilian Portuguese.
               Bugs fixed.

 IMPORTANT: I'm currently looking for bugs on the library. If
            anyone has found one, please send me an email and
            I will fix right away. Thanks for all the help and
            ideias I'm receiving so far.}

{My new email is: gubadaud@terra.com.br}
{Website link   : pngdelphi.sourceforge.net}
{Gustavo Huffenbacher Daud}

unit pngimage;

interface

{Triggers avaliable}

{.$DEFINE UseDelphi}              //Disable fat vcl units (perfect to small apps)
{.$DEFINE ErrorOnUnknownCritical} //Error when finds an unknown critical chunk
{.$DEFINE CheckCRC}               //Enables CRC checking
{.$DEFINE RegisterGraphic}        //Registers TPNGObject to use with TPicture
{.$DEFINE PartialTransparentDraw} //Draws partial transparent images
{.$DEFINE Debug}                 //For programming purposes
{$RANGECHECKS OFF} {$J+}

uses
 Windows {$IFDEF UseDelphi}, SysUtils, Classes, Graphics{$ENDIF}
 {$IFDEF Debug}, dialogs{$IFNDEF UseDelphi}, SysUtils{$ENDIF}{$ENDIF},
 pngzlib, pnglang;

{$IFNDEF UseDelphi}
  const
    soFromBeginning = 0;
    soFromCurrent = 1;
    soFromEnd = 2;
{$ENDIF}

const
  {ZLIB constants}
  ZLIBErrors: Array[-6..2] of string = ('incompatible version (-6)',
    'buffer error (-5)', 'insufficient memory (-4)', 'data error (-3)',
    'stream error (-2)', 'file error (-1)', '(0)', 'stream end (1)',
    'need dictionary (2)');
  Z_NO_FLUSH      = 0;
  Z_FINISH        = 4;
  Z_STREAM_END    = 1;

  {Avaliable PNG filters for mode 0}
  FILTER_NONE    = 0;
  FILTER_SUB     = 1;
  FILTER_UP      = 2;
  FILTER_AVERAGE = 3;
  FILTER_PAETH   = 4;

  {Avaliable color modes for PNG}
  COLOR_GRAYSCALE      = 0;
  COLOR_RGB            = 2;
  COLOR_PALETTE        = 3;
  COLOR_GRAYSCALEALPHA = 4;
  COLOR_RGBALPHA       = 6;


type
  {$IFNDEF UseDelphi}
    {Custom exception handler}
    Exception = class(TObject)
      constructor Create(Msg: String);
    end;
    ExceptClass = class of Exception;
    TColor = ColorRef;
  {$ENDIF}

  {Error types}
  EPNGOutMemory = class(Exception);
  EPngError = class(Exception);
  EPngUnexpectedEnd = class(Exception);
  EPngInvalidCRC = class(Exception);
  EPngInvalidIHDR = class(Exception);
  EPNGMissingMultipleIDAT = class(Exception);
  EPNGZLIBError = class(Exception);
  EPNGInvalidPalette = class(Exception);
  EPNGInvalidFileHeader = class(Exception);
  EPNGIHDRNotFirst = class(Exception);
  EPNGNotExists = class(Exception);
  EPNGSizeExceeds = class(Exception);
  EPNGMissingPalette = class(Exception);
  EPNGUnknownCriticalChunk = class(Exception);
  EPNGUnknownCompression = class(Exception);
  EPNGUnknownInterlace = class(Exception);
  EPNGNoImageData = class(Exception);
  EPNGCouldNotLoadResource = class(Exception);
  EPNGCannotChangeTransparent = class(Exception);
  EPNGHeaderNotPresent = class(Exception);

type
  {Same as TBitmapInfo but with allocated space for}
  {palette entries}
  TMAXBITMAPINFO = packed record
    bmiHeader: TBitmapInfoHeader;
    bmiColors: packed array[0..255] of TRGBQuad;
  end;

  {Transparency mode for pngs}
  TPNGTransparencyMode = (ptmNone, ptmBit, ptmPartial);
  {Pointer to a cardinal type}
  pCardinal = ^Cardinal;
  {Access to a rgb pixel}
  pRGBPixel = ^TRGBPixel;
  TRGBPixel = packed record
    B, G, R: Byte;
  end;

  {Pointer to an array of bytes type}
  TByteArray = Array[Word] of Byte;
  pByteArray = ^TByteArray;

  {Forward}
  TPNGObject = class;
  pPointerArray = ^TPointerArray;
  TPointerArray = Array[Word] of Pointer;

  {Contains a list of objects}
  TPNGPointerList = class
  private
    fOwner: TPNGObject;
    fCount : Cardinal;
    fMemory: pPointerArray;
    function GetItem(Index: Cardinal): Pointer;
    procedure SetItem(Index: Cardinal; const Value: Pointer);
  protected
    {Removes an item}
    function Remove(Value: Pointer): Pointer; virtual;
    {Inserts an item}
    procedure Insert(Value: Pointer; Position: Cardinal);
    {Add a new item}
    procedure Add(Value: Pointer);
    {Returns an item}
    property Item[Index: Cardinal]: Pointer read GetItem write SetItem;
    {Set the size of the list}
    procedure SetSize(const Size: Cardinal);
    {Returns owner}
    property Owner: TPNGObject read fOwner;
  public
    {Returns number of items}
    property Count: Cardinal read fCount write SetSize;
    {Object being either created or destroyed}
    constructor Create(AOwner: TPNGObject);
    destructor Destroy; override;
  end;

  {Forward declaration}
  TChunk = class;
  TChunkClass = class of TChunk;

  {Same as TPNGPointerList but providing typecasted values}
  TPNGList = class(TPNGPointerList)
  private
    {Used with property Item}
    function GetItem(Index: Cardinal): TChunk;
  public
    {Removes an item}
    procedure RemoveChunk(Chunk: TChunk); overload;
    {Add a new chunk using the class from the parameter}
    function Add(ChunkClass: TChunkClass): TChunk;
    {Returns pointer to the first chunk of class}
    function ItemFromClass(ChunkClass: TChunkClass): TChunk;
    {Returns a chunk item from the list}
    property Item[Index: Cardinal]: TChunk read GetItem;
  end;

  {$IFNDEF UseDelphi}
    {The STREAMs bellow are only needed in case delphi provided ones is not}
    {avaliable (UseDelphi trigger not set)}
    {Object becomes handles}
    TCanvas = THandle;
    TBitmap = HBitmap;
    {Trick to work}
    TPersistent = TObject;

    {Base class for all streams}
    TStream = class
    protected
      {Returning/setting size}
      function GetSize: Longint; virtual;
      procedure SetSize(const Value: Longint); virtual; abstract;
      {Returns/set position}
      function GetPosition: Longint; virtual;
      procedure SetPosition(const Value: Longint); virtual;
    public
      {Returns/sets current position}
      property Position: Longint read GetPosition write SetPosition;
      {Property returns/sets size}
      property Size: Longint read GetSize write SetSize;
      {Allows reading/writing data}
      function Read(var Buffer; Count: Longint): Cardinal; virtual; abstract;
      function Write(const Buffer; Count: Longint): Cardinal; virtual; abstract;
      {Copies from another Stream}
      function CopyFrom(Source: TStream;
        Count: Cardinal): Cardinal; virtual;
      {Seeks a stream position}
      function Seek(Offset: Longint; Origin: Word): Longint; virtual; abstract;
    end;

    {File stream modes}
    TFileStreamMode = (fsmRead, fsmWrite, fsmCreate);
    TFileStreamModeSet = set of TFileStreamMode;

    {File stream for reading from files}
    TFileStream = class(TStream)
    private
      {Opened mode}
      Filemode: TFileStreamModeSet;
      {Handle}
      fHandle: THandle;
    protected
      {Set the size of the file}
      procedure SetSize(const Value: Longint); override;
    public
      {Seeks a file position}
      function Seek(Offset: Longint; Origin: Word): Longint; override;
      {Reads/writes data from/to the file}
      function Read(var Buffer; Count: Longint): Cardinal; override;
      function Write(const Buffer; Count: Longint): Cardinal; override;
      {Stream being created and destroy}
      constructor Create(Filename: String; Mode: TFileStreamModeSet);
      destructor Destroy; override;
    end;

    {Stream for reading from resources}
    TResourceStream = class(TStream)
      constructor Create(Instance: HInst; const ResName: String; ResType:PChar);
    private
      {Variables for reading}
      Size: Integer;
      Memory: Pointer;
      Position: Integer;
    protected
      {Set the size of the file}
      procedure SetSize(const Value: Longint); override;
    public
      {Stream processing}
      function Read(var Buffer; Count: Integer): Cardinal; override;
      function Seek(Offset: Integer; Origin: Word): Longint; override;
      function Write(const Buffer; Count: Longint): Cardinal; override;
    end;
  {$ENDIF}

  {Forward}
  TChunkIHDR = class;
  {Interlace method}
  TInterlaceMethod = (imNone, imAdam7);
  {Compression level type}
  TCompressionLevel = 0..9;
  {Filters type}
  TFilter = (pfNone, pfSub, pfUp, pfAverage, pfPaeth);
  TFilters = set of TFilter;

  {Png implementation object}
  TPngObject = class{$IFDEF UseDelphi}(TGraphic){$ENDIF}
  protected
    {Gamma table values}
    GammaTable, InverseGamma: Array[Byte] of Byte;
    procedure InitializeGamma;
  private
    {Filters to test to encode}
    fFilters: TFilters;
    {Compression level for ZLIB}
    fCompressionLevel: TCompressionLevel;
    {Maximum size for IDAT chunks}
    fMaxIdatSize: Cardinal;
    {Returns if image is interlaced}
    fInterlaceMethod: TInterlaceMethod;
    {Chunks object}
    fChunkList: TPngList;
    {Clear all chunks in the list}
    procedure ClearChunks;
    {Returns if header is present}
    function HeaderPresent: Boolean;
    {Returns linesize and byte offset for pixels}
    procedure GetPixelInfo(var LineSize, Offset: Cardinal);
    procedure SetMaxIdatSize(const Value: Cardinal);
    function GetAlphaScanline(const LineIndex: Integer): pByteArray;
    function GetScanline(const LineIndex: Integer): Pointer;
    function GetTransparencyMode: TPNGTransparencyMode;
    function GetTransparentColor: TColor;
    procedure SetTransparentColor(const Value: TColor);
  protected
    {Returns/sets image width and height}
    function GetWidth: Integer; {$IFDEF UseDelphi}override;{$ENDIF}
    function GetHeight: Integer; {$IFDEF UseDelphi}override; {$ENDIF}
    procedure SetWidth(Value: Integer);  {$IFDEF UseDelphi}override; {$ENDIF}
    procedure SetHeight(Value: Integer);  {$IFDEF UseDelphi}override;{$ENDIF}
    {Assigns from another TPNGObject}
    procedure AssignPNG(Source: TPNGObject);
    {Returns if the image is empty}
    function GetEmpty: Boolean; {$IFDEF UseDelphi}override; {$ENDIF}
    {Used with property Header}
    function GetHeader: TChunkIHDR;
    {Draws using partial transparency}
    procedure DrawPartialTrans(DC: HDC; Rect: TRect);
    {$IFDEF UseDelphi}
    {Returns if the image is transparent}
    function GetTransparent: Boolean; override;
    {$ENDIF}
  public
    {Generates alpha information}
    procedure CreateAlpha;
    {Removes the image transparency}
    procedure RemoveTransparency;
    {Transparent color}
    property TransparentColor: TColor read GetTransparentColor write
      SetTransparentColor;
    {Add text chunk, TChunkTEXT}
    procedure AddtEXt(const Keyword, Text: String);
    {$IFDEF UseDelphi}
    {Saves to clipboard format (thanks to Antoine Pottern)}
    procedure SaveToClipboardFormat(var AFormat: Word; var AData: THandle;
      var APalette: HPalette); override;
    procedure LoadFromClipboardFormat(AFormat: Word; AData: THandle;
      APalette: HPalette); override;
    {$ENDIF}
    {Calling errors}
    procedure RaiseError(ExceptionClass: ExceptClass; Text: String);
    {Returns a scanline from png}
    property Scanline[const Index: Integer]: Pointer read GetScanline;
    property AlphaScanline[const Index: Integer]: pByteArray read GetAlphaScanline;
    {Returns pointer to the header}
    property Header: TChunkIHDR read GetHeader;
    {Returns the transparency mode used by this png}
    property TransparencyMode: TPNGTransparencyMode read GetTransparencyMode;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区日韩欧美精品| 中文字幕免费一区| 久久影院午夜片一区| 国产精品亲子伦对白| 午夜欧美视频在线观看 | 久久男人中文字幕资源站| 国产精品久久99| 激情丁香综合五月| 欧美精品一卡二卡| 亚洲欧美日韩国产综合| 激情六月婷婷综合| 欧美一卡二卡在线| 亚洲高清免费观看| 99久久精品久久久久久清纯| 久久亚洲精品国产精品紫薇| 天天综合色天天综合色h| 91免费视频观看| 国产精品美日韩| 国产乱码字幕精品高清av | 日韩成人一区二区三区在线观看| 成人av手机在线观看| 欧美大片日本大片免费观看| 一区二区三区中文在线观看| 国产在线一区二区综合免费视频| 欧美一级精品大片| 无码av免费一区二区三区试看| 91在线云播放| 中文字幕一区二区三区av| 成人国产精品免费网站| 欧美国产精品专区| 高清免费成人av| 中文字幕不卡在线观看| 国产黑丝在线一区二区三区| 久久久一区二区三区捆绑**| 国产中文一区二区三区| 久久日韩精品一区二区五区| 国产麻豆视频一区二区| 国产视频一区二区在线| 成人精品一区二区三区四区| 中文字幕中文字幕一区二区| 99riav一区二区三区| 亚洲欧美成人一区二区三区| 在线精品视频一区二区三四 | 国产日韩欧美精品电影三级在线| 国内一区二区视频| 国产亚洲自拍一区| 成人免费毛片a| 亚洲欧美日韩久久精品| 欧美视频精品在线| 免费一级欧美片在线观看| 日韩精品一区二区三区中文不卡 | 国产三级三级三级精品8ⅰ区| 国产成人在线视频网站| 日韩毛片一二三区| 欧美日韩视频在线第一区 | 国产成人精品网址| 国产精品国产三级国产普通话三级| av一二三不卡影片| 亚洲综合在线免费观看| 日韩欧美精品在线| 成人爱爱电影网址| 亚洲国产成人高清精品| 精品久久久久久久久久久久包黑料| 国产成人超碰人人澡人人澡| 亚洲日本护士毛茸茸| 91麻豆精品国产91久久久| 韩日精品视频一区| 亚洲精品乱码久久久久久| 欧美区一区二区三区| 国产精品88888| 亚州成人在线电影| 久久天天做天天爱综合色| 色网站国产精品| 久久精品免费看| 亚洲摸摸操操av| 日韩欧美国产小视频| 99热99精品| 久久精品99久久久| 一区二区三区加勒比av| 精品国产欧美一区二区| 在线国产亚洲欧美| 国产精品一卡二卡在线观看| 日本欧美一区二区| 国产精品欧美一区二区三区| 欧美绝品在线观看成人午夜影视| 成人av综合一区| 精品一区二区三区久久| 一区二区三区日韩在线观看| 国产欧美一区二区精品忘忧草| 欧美久久久久久久久久| 色美美综合视频| 国产成人综合亚洲网站| 美女精品一区二区| 日韩欧美一区二区在线视频| 91麻豆免费观看| 久久久久久**毛片大全| 男男视频亚洲欧美| 国产精品久99| 正在播放亚洲一区| 国产精品成人一区二区三区夜夜夜 | 日韩西西人体444www| 91香蕉视频mp4| 成人av免费在线播放| 激情文学综合网| 久久精品999| 日本不卡视频一二三区| 日韩高清不卡一区二区三区| 午夜精品久久久久久久蜜桃app | 91免费版在线看| 成人精品在线视频观看| 国产凹凸在线观看一区二区| 久久品道一品道久久精品| 爽好多水快深点欧美视频| 亚洲一区二区三区激情| 亚洲综合色区另类av| 亚洲精品国产高清久久伦理二区| 国产精品天天摸av网| 国产精品久久久久久久久久久免费看| 久久精品亚洲精品国产欧美kt∨| 精品久久99ma| 久久色在线观看| 国产精品素人一区二区| 国产精品高潮久久久久无| 亚洲人成网站影音先锋播放| 亚洲综合色成人| 亚洲高清免费视频| 麻豆91在线观看| 经典三级视频一区| 国产精品白丝jk黑袜喷水| 国产精品12区| 91色porny在线视频| 欧美手机在线视频| 日韩免费高清视频| 国产午夜亚洲精品不卡| 亚洲特级片在线| 图片区小说区国产精品视频| 麻豆精品久久精品色综合| 韩国av一区二区三区在线观看| 国产sm精品调教视频网站| 成年人国产精品| 欧美日韩在线三区| 精品成人在线观看| 国产精品成人一区二区三区夜夜夜| 又紧又大又爽精品一区二区| 日本视频在线一区| 高清国产一区二区| 欧美日韩性生活| 久久久精品日韩欧美| 有坂深雪av一区二区精品| 免费高清不卡av| 91美女在线观看| 日韩一二在线观看| 国产精品每日更新在线播放网址| 亚洲图片有声小说| 国产精选一区二区三区| 91视频在线观看免费| 欧美精品一区二区不卡| 亚洲男帅同性gay1069| 久久精品久久精品| 在线看国产一区二区| 久久综合久久鬼色中文字| 一区二区三区在线观看欧美| 国产精品自拍毛片| 欧美日韩精品综合在线| 欧美国产一区二区| 免费人成网站在线观看欧美高清| 99国产精品久| 久久免费看少妇高潮| 亚洲成人av一区二区三区| 国产精华液一区二区三区| 欧美日本国产一区| 中文字幕日韩一区| 国产一区二区伦理片| 欧美三级电影在线观看| 国产清纯在线一区二区www| 五月激情综合网| 国产盗摄一区二区| 国产成都精品91一区二区三| 中文字幕一区免费在线观看| av亚洲精华国产精华精| 亚洲一区二区三区中文字幕在线| 欧美丝袜丝交足nylons图片| 国产日本一区二区| 蜜桃av一区二区三区| 欧美三级视频在线| 一区二区在线观看视频在线观看| 国产精品一区二区免费不卡| 精品国产一区二区三区久久久蜜月| 亚洲色图欧洲色图婷婷| 成人永久aaa| 久久综合久久鬼色中文字| 蜜桃久久久久久久| 欧美日韩另类国产亚洲欧美一级| 亚洲免费观看视频| 色综合久久88色综合天天6| 中文字幕不卡的av| 风间由美一区二区av101| 久久久国产精华| 国产乱人伦偷精品视频不卡| 337p日本欧洲亚洲大胆精品|