public string ToString(string format) { return($"Ox step: {Ox.ToString(format)}\tNumber of steps: {Nx}\tOy step: {Oy.ToString(format)}\tNumber of steps: {Ny}"); }
public override string ToString() { return("V3DataOnGrid\n" + base.ToString() + "\nOx: " + Ox.ToString() + "Oy: " + Oy.ToString()); }
} // LeerDevmode /** \brief Lectura registro EmrHeader * \details Lectura y analisis registro EMR_HEADER, Su estructura se define en el documento MS-EMF, título 2.3.4.2. * \param ArrayEmrHeader Array con el contenido del registro EMR_HEADER. * \param PrintJob Estructura pasada por referencia para guardar las propiedades del trabajo de impresión * \param Position Posición del registro EMR_HEADER en el fichero de Spool */ private void AnalizeEmrHeader(byte [] ArrayEmrHeader, ref STRUCT_PRINT_JOB PrintJob, int Position) { // Primeros elementos del registro: // - Type: 4 bytes (ya leido) // - Size: 4 bytes (ya leido) // - Bounds: 16 bytes. // - Frame: 16 bytes. PuntoOrigen (Ox, Oy) Punto Final (Fx, Fy) // El resto de elementos no nos analizamos por que no lo necesitamos. int PosicionFrame = 24; // (Type + Size + Bounds) bytes // Coordenadas del frame uint Ox, Oy, Fx, Fy; Ox = (uint)BitConverter.ToInt32(ArrayEmrHeader, PosicionFrame); PosicionFrame += 4; Oy = (uint)BitConverter.ToInt32(ArrayEmrHeader, PosicionFrame); PosicionFrame += 4; Fx = (uint)BitConverter.ToInt32(ArrayEmrHeader, PosicionFrame); PosicionFrame += 4; Fy = (uint)BitConverter.ToInt32(ArrayEmrHeader, PosicionFrame); Log.Info(" " + Util.MostrarHex((UInt32)(Position + PosicionFrame)) + " Frame: " + "(" + Ox.ToString() + ", " + Oy.ToString() + "), (" + Fx.ToString() + ", " + Fy.ToString() + ")"); // El siguiente If es por si un trabajo de impresión no tuviese el mismo tamaño de página para todas las páginas. // Comparamos con el tamaño de página guardado en el trabajo de impresión. Si el tamaño de página del EMR_HEADER es mayor actualizamos en el trabajo de impresion. if ((PrintJob.N_WIDTH * PrintJob.N_LENGTH) < ((Fx - Ox) * (Fy - Oy))) { PrintJob.N_WIDTH = (int)(Fy - Oy); PrintJob.N_LENGTH = (int)(Fx - Ox); } } // Fin LeerEmrHeader