Board index » delphi » How to get video RAM size?

How to get video RAM size?

Hello,

How is it possible to retrieve the video card's video RAM size?

Thank you,
Dmitri Papichev

 

Re:How to get video RAM size?


Use IDirectDraw::GetCaps

Feng Yuan  ( for the GDI book to read, check www.fengyuan.com )

Re:How to get video RAM size?


Hello,

Quote
"Feng Yuan" <fengy...@home.com> wrote in message news:3ab6f0ac_1@dnews...
> Use IDirectDraw::GetCaps

Thank you, Feng.
Is there any other way to accomplish that, without DirectX stuff involved?

Dmitri Papichev

Re:How to get video RAM size?


Quote
>Dmitri Papichev wrote:

> How is it possible to retrieve the video card's video RAM size?

Get the video card settings with EnumDisplaySettings.
Calculate the amount of RAM from (width * height * colours).

procedure TForm1.Button1Click(Sender: TObject);
var
  DeviceMode: TDeviceMode;
  i, m, max: Integer;
begin
  max := 0;
  i := 0;
  while EnumDisplaySettings(nil, i, DeviceMode) do
  begin
    with DeviceMode do
      m := Round(dmPelsWidth * dmPelsHeight * (dmBitsPerPel/8));
    if m > max then
      max := m;
    inc(i);
  end;
  ShowMessage(IntToStr(max));
end;
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5
Direct replies mailto:p...@augsburg.netsurf.de

Re:How to get video RAM size?


Hello,

Quote
"Andreas Pawlik" <p...@augsburg.netsurf.de> wrote in message

news:3AB7C0CA.819CD612@augsburg.netsurf.de...

Quote
> Get the video card settings with EnumDisplaySettings.
> Calculate the amount of RAM from (width * height * colours).

Thank a lot, Andreas, I need something like this. I just hoped that there
might be some API call to retrieve the exact amount of video RAM. The only
issue here is that the code seems to work unstable, causing sometimes an
invalid page fault in USER32.DLL, I had no time to investigate it thoroughly
yet.

Best regards,
Dmitri Papichev

Other Threads