Detect display size - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

Detect display size

  • 3 Replies
  • 924 Views
Detect display size
« on: 20 / March / 2023, 13:53:30 »
Advertisements
@reyalp @philmoz

I've spotted a strangeness that I don't understand.

I use the following function to detect if the LCD, EVF or HDMI is being used on my G5X:

Code: [Select]
function check_screen()
    if get_gui_screen_width() == 360 and get_gui_screen_height() == 240 then -- using the LCD
        vx = 360
        vy = 240
    elseif get_gui_screen_width() == 480 and get_gui_screen_height() == 270 then -- using the HDMI out
        vx = 480
        vy = 270
    elseif get_gui_screen_width() == 344 and get_gui_screen_height() == 270 then -- using the EVF (at least on a G5X)
        vx = 344
        vy = 270
    end
end

For the LCD and HDMI output all is OK and if, as I do, draw a black box , eg (0,0) to (vx,20), sure enough I get a black box across the full width, as expected.

However, on the EVF, the box doesn't go to the far right, ie it looks like a gap of around 10-15 pixels (guessing) and this remains the case even if I push VF beyond the screen width of the EVF, ie 344, which reported by the get screen width call.

Any insight?

Cheers

Garry
« Last Edit: 20 / March / 2023, 14:33:10 by pigeonhill »

Re: Detect display size
« Reply #1 on: 20 / March / 2023, 14:36:28 »
btw.

344 for the EVF looks wrong to me.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Detect display size
« Reply #2 on: 20 / March / 2023, 16:36:20 »
That's a quirk of the G5X.
For some reason the EVF gets clipped at 347 pixels wide when using the XIMR buffer for CHDK.
To keep the width a multiple of 8 I set it to 344.
The full width (of the Canon buffer) is 360 so there is a blank area on the right for the CHDK buffer).


I was unable to find out why this happens or fix it.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Detect display size
« Reply #3 on: 20 / March / 2023, 17:05:12 »
@philmoz

Thanks for explaning.

It won't impact the core functionality of my script.

Cheers

Garry


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal