Direct2D Question

  • Thread starter Thread starter Paul Ishak
  • Start date Start date
P

Paul Ishak

Guest
I am trying to get the simplest possible working implementation of direct2d in a CLR project.


The steps I have taken so far to make my project are:

1.) I Create New c++ CLR Empty Project

2.) Go to header folder, right click>Add>New Item: I select UI, then I select Windows Form, then I click ADD

3.) I move the MyForm.cpp file to the source directory

4.) I put the following code into my MyForm.cpp file:

#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
int main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Project4::MyForm form;
Application::Run(%form);
return 0;
}



5.) In solution explorer, I right click my project->Configuration Properties>Linker>System>Subsystem> and select windows

Then in Configuration Properties>Linker>Advanced>Entry point> I put "main"

6.) I go to the designer view of "MyForm", and I add a System.Windows.Forms.Panel


My question is that I would like to use the panel as my Direct2D canvas.

An explanation on how I can proceed here to use that panel as my Direct2d render target, and an example that draws a simple line on said panel(using Direct2d, not gdi) would be outstanding.

Thank you in advance!


---Or is it not possible?


“If you want something youve never had, you need to do something youve never done.”

Dont forget to mark helpful posts and answers ! Answer an interesting question? Write a new article about it! My Articles
*This post does not reflect the opinion of Microsoft, or its employees.

Continue reading...
 
Back
Top