Show / Hide Table of Contents

Class ImgFile

Connects to a *.IMG file to enumerate and extract image data. Each IMG file contains a single image.

Inheritance
Object
BaseImageFile
ImgFile
Inherited Members
BaseImageFile.myPalette
BaseImageFile.FilePath
BaseImageFile.FileName
BaseImageFile.Palette
BaseImageFile.LoadPalette(String)
BaseImageFile.GetColor32(Int32, Int32, Int32)
BaseImageFile.GetColor32(DFBitmap, Int32)
BaseImageFile.GetColor32(Int32, Int32, Int32, Int32, DFSize)
BaseImageFile.GetColor32(DFBitmap, Int32, Int32, DFSize, Int32, Int32)
BaseImageFile.GetWindowColors32(DFBitmap, Int32)
BaseImageFile.GetSpectralEmissionColors32(DFBitmap, Color32[], Int32, Int32, Color, Color)
BaseImageFile.GetFireWallColors32(Color32[], Int32, Int32, Color, Single)
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class ImgFile : BaseImageFile

Constructors

| Improve this Doc View Source

ImgFile()

Default constructor.

Declaration
public ImgFile()
| Improve this Doc View Source

ImgFile(String, FileUsage, DFPalette, Boolean)

Load constructor with palette assignment. Some IMG files contain palette information, this will overwrite the specified palette.

Declaration
public ImgFile(string filePath, FileUsage usage, DFPalette palette, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to *.IMG file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

DFPalette palette

Palette to use when building images.

Boolean readOnly

File will be read-only if true, read-write if false.

| Improve this Doc View Source

ImgFile(String, FileUsage, Boolean)

Load constructor.

Declaration
public ImgFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to *.IMG file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

Boolean readOnly

File will be read-only if true, read-write if false.

| Improve this Doc View Source

ImgFile(String, FileUsage, String, Boolean)

Load constructor that also loads a palette. Some IMG files contain palette information, this will overwrite the specified palette.

Declaration
public ImgFile(string filePath, FileUsage usage, string paletteFilePath, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to *.IMG file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

String paletteFilePath

Absolute path to Daggerfall palette file.

Boolean readOnly

File will be read-only if true, read-write if false.

Properties

| Improve this Doc View Source

Description

Description of this file (always "IMG File" as the game files contain no text descriptions for this file type).

Declaration
public override string Description { get; }
Property Value
Type Description
String
Overrides
BaseImageFile.Description
| Improve this Doc View Source

ImageOffset

Gets XOffset and YOffset from image header.

Declaration
public DFPosition ImageOffset { get; }
Property Value
Type Description
DFPosition
| Improve this Doc View Source

IsPalettized

Specifies if this IMG file defines its own palette.

Declaration
public bool IsPalettized { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

PaletteName

IMG files use a variety of palettes. This property returns the correct palette filename to use for this image. Palettized images (check IsPalettized flag) will return String.Emtpy for the palette filename.

Declaration
public override string PaletteName { get; }
Property Value
Type Description
String
Overrides
BaseImageFile.PaletteName
| Improve this Doc View Source

RecordCount

Number of image records in this Img file.

Declaration
public override int RecordCount { get; }
Property Value
Type Description
Int32
Overrides
BaseImageFile.RecordCount

Methods

| Improve this Doc View Source

GetDFBitmap()

Gets bitmap data as indexed 8-bit byte array.

Declaration
public DFBitmap GetDFBitmap()
Returns
Type Description
DFBitmap

DFBitmap object.

| Improve this Doc View Source

GetDFBitmap(Int32, Int32)

Gets bitmap data as indexed 8-bit byte array for specified record and frame. This method is an override for abstract method in parent class DFImageFile. As IMG files only have 1 image the Record and Frame indices must always be 0 when calling this method.

Declaration
public override DFBitmap GetDFBitmap(int record, int frame)
Parameters
Type Name Description
Int32 record

Index of record. Must be 0.

Int32 frame

Index of frame. Must be 0.

Returns
Type Description
DFBitmap

DFBitmap object.

Overrides
BaseImageFile.GetDFBitmap(Int32, Int32)
| Improve this Doc View Source

GetFrameCount(Int32)

Gets number of frames in specified record.

Declaration
public override int GetFrameCount(int record)
Parameters
Type Name Description
Int32 record

Index of record. Must be 0 for Img files.

Returns
Type Description
Int32

Number of frames. Always 1 for loaded Img files.

Overrides
BaseImageFile.GetFrameCount(Int32)
| Improve this Doc View Source

GetHeaderlessFileImageDimensions()

IMG files have a fixed width and height not specified in a header. This method returns the correct dimensions of images inside these files.

Declaration
protected DFSize GetHeaderlessFileImageDimensions()
Returns
Type Description
DFSize

Dimensions of image.

| Improve this Doc View Source

GetSize(Int32)

Gets width and height of specified record. As IMG files only have 1 record, this must be 0.

Declaration
public override DFSize GetSize(int record)
Parameters
Type Name Description
Int32 record

Index of record. Must be 0.

Returns
Type Description
DFSize

DFSize object.

Overrides
BaseImageFile.GetSize(Int32)
| Improve this Doc View Source

IsFilenameSupported(String)

Tests if a filename is supported.

Declaration
public bool IsFilenameSupported(string filename)
Parameters
Type Name Description
String filename

Name of *.IMG file.

Returns
Type Description
Boolean

True if supported, otherwise false.

| Improve this Doc View Source

Load(String, FileUsage, Boolean)

Loads an IMG file.

Declaration
public override bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to *.IMG file

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

Boolean readOnly

File will be read-only if true, read-write if false.

Returns
Type Description
Boolean

True if successful, otherwise false.

Overrides
BaseImageFile.Load(String, FileUsage, Boolean)
| Improve this Doc View Source

UnsupportedFilenames()

Gets unsupported filenames. The three IMG filenames returned have no image data or are otherwise invalid.

Declaration
public string[] UnsupportedFilenames()
Returns
Type Description
String[]

Array of unsupported filenames.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX