public override void ReadData(IDjvuReader reader) { DataOffset = reader.Position; Width = reader.ReadUInt16BigEndian(); Height = reader.ReadUInt16BigEndian(); MinorVersion = reader.ReadByte(); MajorVersion = reader.ReadByte(); DPI = reader.ReadUInt16(); // LSB Gamma = (float)reader.ReadByte() / 10; byte flag = reader.ReadByte(); switch (flag & 0x7) { case 6: PageRotation = PageRotation.CounterClockwise; break; case 2: PageRotation = PageRotation.UpsideDown; break; case 5: PageRotation = PageRotation.Clockwise; break; default: PageRotation = PageRotation.RightSideUp; break; } }
public Vector2 PageToDevice(int startX, int startY, int sizeX, int sizeY, PageRotation rotation, int pageX, int pageY) { int deviceX; int deviceY; FPDF_PageToDevice(m_NativePointer, startX, startY, sizeX, sizeY, (int)rotation, pageX, pageY, out deviceX, out deviceY); return(new Vector2(deviceX, deviceY)); }
public Vector2 DeviceToPage(int startX, int startY, int sizeX, int sizeY, PageRotation rotation, int deviceX, int deviceY) { double pageX; double pageY; FPDF_DeviceToPage(m_NativePointer, startX, startY, sizeX, sizeY, (int)rotation, deviceX, deviceY, out pageX, out pageY); return(new Vector2((float)pageX, (float)pageY)); }
private void SetPageRotate(PageRotation pr) { switch (pr) { case PageRotation.Rotate0: rotateAngle = 0.0F; break; case PageRotation.Rotate90: rotateAngle = 90.0F; break; case PageRotation.Rotate180: rotateAngle = 180.0F; break; case PageRotation.Rotate270: rotateAngle = 270.0F; break; default: rotateAngle = 0; break; } }