BBC BASIC for Windows
« prochugewindow fails at 5120x2880 pixels »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:59pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: prochugewindow fails at 5120x2880 pixels  (Read 291 times)
AndrewCool
New Member
Image


member is offline

Avatar




PM


Posts: 8
xx prochugewindow fails at 5120x2880 pixels
« Thread started on: Dec 10th, 2015, 03:00am »

Hi All,

Work has been kind enough to equip me with a new 5k monitor, with a resolution of 5120x2880 pixels.

Alas, prochugewindow (from BB4W Help) fails, and returns
"Couldn't create DIBSection."

The PC has 32GB or RAM and a GTX970 Graphics card with 4GB of memory, running Win7 64bit.

Is this failure due to a physical setup limitation, or something within BB4W itself?

I realize that 5120x2880 is very much pushing the envelope now, but in 5 years time I'd expect even that to be a common or garden resolution. Google reports that Nvidia are already working on support for 8k monitors!

Regards,

Andrew

prochugewindow(5120,2880)

def prochugewindow(x%, y%) : local bmih{}, bits%, hbm%, oldbm%
dim bmih{Size%, Width%, Height%, Planes{l&,h&}, BitCount{l&,h&}, \
\ Compression%, SizeImage%, XPelsPerMeter%, YPelsPerMeter%, \
\ ClrUsed%, ClrImportant%}
bmih.Size% = dim(bmih{})
bmih.Width% = x%
bmih.Height% = y%
bmih.Planes.l& = 1
bmih.BitCount.l& = 24
sys "CreateDIBSection", @memhdc%, bmih{}, 0, ^bits%, 0, 0 to hbm%
if hbm% = 0 error 100, "Couldn't create DIBSection"
sys "SelectObject", @memhdc%, hbm% to oldbm%
sys "DeleteObject", oldbm%

sys "SetWindowPos", @hwnd%, 0, 0, 0, x%, y%, 6
@vdu%!208 = x%
@vdu%!212 = y%
vdu 24,0;0;x%*2-2;y%*2-2;
clg
endproc

User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: prochugewindow fails at 5120x2880 pixels
« Reply #1 on: Dec 10th, 2015, 10:09am »

Hi Andrew,

This is probably one where you might want to contact Richard Russell directly: I understand he is no longer monitoring this forum regularly.

For what it's worth, I would think:

1) I reckon you are asking for a bitmap of about 44MB, which is well within your system resources

2) The fact that it is CreateDIBSection (a system call) that is failing suggests that the issue is with the system rather than BB4W - all of the parameters you are passing are within the acceptable range of the variables, I think.

3) As I understand it, the system call will take the memory from system memory,so I don't think you are running BB4W out of memory.

This (see below) works for me, in both BB4W v5.95 and 6.01a, on a much smaller machine (Win7/64, 4GB) so I don't think its a BB4W problem - but the window produced appears to be capped at the size of my two monitors (2560 x 1024 total) (though I have no way to check it's depth, since I can't move it up....), so it may become an issue when the window is bigger.

Note that the text viewport won't be as big, and according to the manual if you make it that big everything will go horribly wrong....

Best wishes,

D

PS When your work buys you an 8k monitor, if you want to mail me the old 5k one, that will be fine... :-)
Code:
      PROChugewindow(5120, 2880)
      PRINT "Hello"
      END

      DEF PROChugewindow(x%, y%) : LOCAL bmih{}, bits%, hbm%, oldbm%
      DIM bmih{Size%, Width%, Height%, Planes{l&,h&}, BitCount{l&,h&}, \
      \        Compression%, SizeImage%, XPelsPerMeter%, YPelsPerMeter%, \
      \        ClrUsed%, ClrImportant%}
      bmih.Size% = DIM(bmih{})
      bmih.Width% = x%
      bmih.Height% = y%
      bmih.Planes.l& = 1
      bmih.BitCount.l& = 24
      SYS "CreateDIBSection", @memhdc%, bmih{}, 0, ^bits%, 0, 0 TO hbm%
      IF hbm% = 0 ERROR 100, "Couldn't create DIBSection"
      SYS "SelectObject", @memhdc%, hbm% TO oldbm%
      SYS "DeleteObject", oldbm%
      SYS "SetWindowPos", @hwnd%, 0, 0, 0, x%, y%, 6
      @vdu%!208 = x%
      @vdu%!212 = y%
      VDU 24,0;0;x%*2-2;y%*2-2;
      CLG
      ENDPROC
 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls