Class TPictureEditorDlg2 (unit PictEd32) |
TForm
Constructors |
Functions |
Properties |
Events |
Variables |
Constructors |
Functions |
type TNVLType = (nvlOther, nvlJPG, nvlGIF, nvlJIF, nvlBMP, nvlDIB, nvlRLE, nvlTGA, nvlPCX); function NVLLoadImage(FileName: PChar; ShowProgress: BooLean): HBitmap; stdcall; external 'NViewLib.dll' name 'NViewLibLoad'; function NVLGetType(FileName: string): TNVLType; var i: Byte; begin Result := nvlOther; FileName := ExtractFileName(FileName); repeat i := Pos('.', FileName); if (i <> 0) then FileName := Copy(FileName, i+1, Length(FileName)-i); until (i = 0); for i := 1 to Length(FileName) do FileName[i] := UpCase(FileName[i]); if (FileName = 'JPG') then Result := nvlJPG else if (FileName = 'GIF') then Result := nvlGIF else if (FileName = 'JIF') then Result := nvlJIF else if (FileName = 'BMP') then Result := nvlBMP else if (FileName = 'DIB') then Result := nvlDIB else if (FileName = 'RLE') then Result := nvlRLE else if (FileName = 'TGA') then Result := nvlTGA else if (FileName = 'PCX') then Result := nvlPCX; end; function NVLLoadImage(const FileName: string; SP: Boolean): TBitmap; var FN: PChar; BMP: Graphics.TBitmap; R: TRect; begin Result := nil; if (FileName = '') then Exit; GetMem(FN, Length(FileName)+1); StrPCopy(FN, FileName); { Use a temp bmp because MViewLib maintains only 1 handle! } BMP := Graphics.TBitmap.Create; try BMP.Handle := LoadImage(FN, SP); finally end; FreeMem(FN, Length(FileName)+1); if (BMP.Handle <> 0) then begin Result := Graphics.TBitmap.Create; try with Result do begin Width := BMP.Width; Height := BMP.Height; R := Rect(0, 0, Width, Height); Canvas.CopyRect(R, BMP.Canvas, R); end finally DeleteObject(BMP.Handle); end; end; BMP.Free; end; *) {$R *.DFM} { TPictureEditorDlg
Properties |
Events |
Variables |