@jon and @Leo, Would it be possible for the scale or zoom factor to always be displayed when opening any image, regardless of the display mode we have selected in settings?
Original size mode
![]()
Fit to window mode
![]()
@jon and @Leo, Would it be possible for the scale or zoom factor to always be displayed when opening any image, regardless of the display mode we have selected in settings?
Original size mode
![]()
Fit to window mode
![]()
The following code calculates the scale of the image displayed in the viewer, on the screen. Is there a way to display this calculated value as a dynamic label in the viewer, meaning that it would automatically update with each image change? Thank you.
function OnInit(initData) {
initData.name = "Escala Imagen";
initData.version = "1.0";
initData.copyright = "(c) 2025 DASOTA";
}
function OnAddCommands(addCmdData) {
var cmd = addCmdData.AddCommand();
cmd.name = 'EscalaImagen';
cmd.method = 'OnEscalaImagen';
cmd.label = 'Escala Imagen';
}
function OnEscalaImagen(scriptCmdData) {
var viewer = DOpus.viewers.lastactive;
var item = viewer.current;
var sysinfo = DOpus.Create.SysInfo();
var monitor = sysinfo.Monitors(0);
var ancho_pantalla = monitor.width;
var alto_pantalla = monitor.height;
var ancho_imagen = item.metadata.image.picwidth;
var alto_imagen = item.metadata.image.picheight;
var escala_ancho = ancho_pantalla / ancho_imagen;
var escala_alto = alto_pantalla / alto_imagen;
var escala_inicial = Math.min(escala_ancho, escala_alto, 1.0);
var escala_final = Math.round(escala_inicial * 100) + "%";
DOpus.Output(escala_final);
}
We've added this for the next update. Thanks for the suggestion!
Thank you so much @Jon for considering my suggestion!