Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7750339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:15:56+00:00 2026-06-01T11:15:56+00:00

I’ve made a simple C# WinForms app, which makes a screen-capture using System; using

  • 0

I’ve made a simple C# WinForms app, which makes a screen-capture

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SlimDX.Direct3D9;
using SlimDX;

namespace KMPP
{
    public class DxScreenCapture
    {
        Device d;

        public DxScreenCapture()
        {
            PresentParameters present_params = new PresentParameters();
            present_params.Windowed = true;
            present_params.SwapEffect = SwapEffect.Discard;

            d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);
        }

        public Surface CaptureScreen()
        {
            Surface s = Surface.CreateOffscreenPlain(d, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.Scratch);
            d.GetFrontBufferData(0, s);
            return s;
        }
    }
}

now to call it:

using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using SlimDX.Direct3D9;
using SlimDX;
using KMPP;
using System.Diagnostics;
using System.Threading;

namespace dxcapture
{
    public partial class Form1 : Form
    {
        DxScreenCapture sc = new DxScreenCapture();
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            Stopwatch stopwatch = new Stopwatch();
            DateTime current = DateTime.Now;

            string n = string.Format(@"text-{0:yyyy-MM-dd_hh-mm-ss-tt}.bmp",DateTime.Now);

            string directory = (@"C:\temp\");
            string name = (".bmp");
            string filename = String.Format("{0:hh-mm-ss}{1}", DateTime.Now, name);
            string path = Path.Combine(directory, filename);


            stopwatch.Start();

            Thread.Sleep(1000);

            Surface s = sc.CaptureScreen();
            Surface.ToFile(s, path, ImageFileFormat.Bmp);
            stopwatch.Stop();
            s.Dispose();

            textBox1.Text = ("Elapsed:" + stopwatch.Elapsed.TotalMilliseconds);


        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

    }
}

Everything works fine when I run this app on Windows 7 x64 (it was compiled here)

Unfortunately, when I try to run this app on Windows XP x86 machine – I’m getting following error:

http://i.minus.com/ipilqHeWqbvKe.png

How I tried to fix it?

  • installed latest DX on WinXP

  • installed latest SlimDX on WinXP (btw this step solved my previous problem)

  • installed latest .Net Framework v.4 on WinXP

  • compiled this app as x86 and used SlimDX.dll x86 for the same reason

  • I also put slimdx.dll into the same folder where dxcapture.exe (app name) is located

What might be the problem? Does WinXP support Directx9 screen capture?

edit: I’ve tried to comment-out different code-lines and it seems like “device creation” is the problem.. I mean this line:

            d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);

WinXP machine has integrated ATI graphics, so, I don’t know.. maybe that’s the problem, maybe not, but I can’t check my program on some other pc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:15:58+00:00Added an answer on June 1, 2026 at 11:15 am

    As mentioned in the bug report you filed, the problem appears to be with your system, whether it be missing DirectX components or your graphics adapter not supporting Direct3D 9. If your card doesn’t at least support D3D9, you won’t be able to use SlimDX (or any of the other DirectX wrappers) for any kind of rendering.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.