0

I am a beginner so my question might sound silly. I have a IDXGISurface which holds some data/image. I wish to crop certain rectangle areas out of it and store it into same IDXGISurface or another similar surface. I believe Direct2D provides a way to do it through layers. Any guidance on this (preferable step by step) would be helpful.

Jeff
  • 2,495
  • 18
  • 38
SentyGuy
  • 11
  • 1
  • What have you tried so far? Could you give some code snippets that you have tried or working already? – MWiesner Sep 29 '15 at 18:00
  • I am trying to do as follows: 1. D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &Direct2D); //create D2 factory 2. Direct2D->CreateDevice(DxgiDevice, &Direct2DDevice);//create d2 device. 3.Direct2DDevice->CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &Screen); // create d2 device context 4. Screen->CreateBitmapFromDxgiSurface(dxgiBackBuffer, &bitmapProperties, &Direct2DBitmap);//create bitmap from IDXGISurface 5. Screen->PushLayer(...... //Direct 2D Drawing. Now will this result in drawing in dxgiBackbuffer mentioned in step 4. Awaiting your reply – SentyGuy Sep 30 '15 at 04:16
  • 1
    It might be a good idea to add the code in your question, instead in form of a comment. – Anton Angelov Oct 01 '15 at 20:33

0 Answers0