Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: casting between pointers Pin
Code-o-mat16-Jun-10 22:08
Code-o-mat16-Jun-10 22:08 
GeneralRe: casting between pointers Pin
Iosif Murariu16-Jun-10 22:11
Iosif Murariu16-Jun-10 22:11 
GeneralRe: casting between pointers Pin
Code-o-mat16-Jun-10 22:52
Code-o-mat16-Jun-10 22:52 
AnswerRe: casting between pointers [modified] Pin
Aescleal16-Jun-10 22:29
Aescleal16-Jun-10 22:29 
GeneralRe: casting between pointers Pin
Iosif Murariu16-Jun-10 22:39
Iosif Murariu16-Jun-10 22:39 
GeneralRe: casting between pointers Pin
Aescleal16-Jun-10 22:58
Aescleal16-Jun-10 22:58 
AnswerRe: casting between pointers Pin
Tim Craig17-Jun-10 18:08
Tim Craig17-Jun-10 18:08 
QuestionDirect2D - printing / create windows meta file Pin
thomas1234516-Jun-10 21:26
thomas1234516-Jun-10 21:26 
Does anyone know if it's possible to print graphics using Direct2D together with a printer-based HDC (i.e. CPrintInfo, DoPreparePrinting(), etc)?

Using the ID2D1DCRenderTarget interface and the BindDC method works just fine when drawing to a screen-based DC (or to a bitmap, which is blitted to screen later), but when the DC represents a printer the BindDC method returns E_INVALIDARG.

D2D1_RENDER_TARGET_PROPERTIES props = D2D1::RenderTargetProperties(
   D2D1_RENDER_TARGET_TYPE_HARDWARE,
   D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE),
   0,
   0,
   D2D1_RENDER_TARGET_USAGE_NONE,
   D2D1_FEATURE_LEVEL_DEFAULT);

ID2D1DCRenderTargetPtr pRT;
Globals::g_D2DFactory->CreateDCRenderTarget(&props, &pRT);

int sizeX=pDC->GetDeviceCaps(HORZSIZE);
int sizeY=pDC->GetDeviceCaps(VERTSIZE);

CRect rect(0, 0, sizeX, sizeY);
hr = pRT->BindDC(pDC->m_hDC, rect);   // E_INVALIDARG
if (FAILED(hr))
{
   const char* szErr = DXGetErrorStringA(hr);
   const char* szDesc = DXGetErrorDescriptionA(hr);
   ATLTRACE("BindDC: %s - %s\n", szErr, szDesc);
}

pDC->MoveTo(10,10);   // GDI works!!
pDC->LineTo(200,200);


The same thing happens if the DC is a CMetaFileDC.

The DC seems to be OK, because it works just fine to draw GDI onto that DC.

Is the ID2D1RenderTarget created with incompatible parameters? Should I pass a different pixel format?

Please help.

Thanks.
AnswerRe: Direct2D - printing / create windows meta file Pin
salvapatuel230-Jun-10 6:41
salvapatuel230-Jun-10 6:41 
QuestionPDF Creation Pin
Pryabu16-Jun-10 20:35
Pryabu16-Jun-10 20:35 
AnswerRe: PDF Creation Pin
«_Superman_»16-Jun-10 20:51
professional«_Superman_»16-Jun-10 20:51 
GeneralRe: PDF Creation Pin
Pryabu16-Jun-10 21:12
Pryabu16-Jun-10 21:12 
AnswerRe: PDF Creation Pin
mesajflaviu17-Jun-10 5:52
mesajflaviu17-Jun-10 5:52 
QuestionEncrypt text using java and decrypt using C Pin
Murugan k16-Jun-10 19:36
Murugan k16-Jun-10 19:36 
AnswerRe: Encrypt text using java and decrypt using C PinPopular
Cedric Moonen16-Jun-10 20:12
Cedric Moonen16-Jun-10 20:12 
QuestionRe: Encrypt text using java and decrypt using C Pin
Niklas L16-Jun-10 20:39
Niklas L16-Jun-10 20:39 
AnswerRe: Encrypt text using java and decrypt using C Pin
Moak17-Jun-10 10:49
Moak17-Jun-10 10:49 
GeneralRe: Encrypt text using java and decrypt using C Pin
Niklas L17-Jun-10 11:18
Niklas L17-Jun-10 11:18 
AnswerRe: Encrypt text using java and decrypt using C Pin
Aescleal16-Jun-10 22:43
Aescleal16-Jun-10 22:43 
AnswerRe: Encrypt text using java and decrypt using C Pin
ThatsAlok16-Jun-10 23:54
ThatsAlok16-Jun-10 23:54 
GeneralRe: Encrypt text using java and decrypt using C Pin
Aescleal18-Jun-10 9:23
Aescleal18-Jun-10 9:23 
QuestionCClientDc Pin
VVVimal16-Jun-10 18:39
VVVimal16-Jun-10 18:39 
AnswerRe: CClientDc Pin
«_Superman_»16-Jun-10 18:54
professional«_Superman_»16-Jun-10 18:54 
AnswerRe: CClientDc Pin
Stephen Hewitt16-Jun-10 19:23
Stephen Hewitt16-Jun-10 19:23 
AnswerRe: CClientDc Pin
Aescleal16-Jun-10 22:50
Aescleal16-Jun-10 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.