Home > Software engineering >  Use CXimag the draw drawing, images can be beyond the scope of HDC?
Use CXimag the draw drawing, images can be beyond the scope of HDC?

Time:10-08

I put the control of HDC has handed into the Draw function as a parameter, but the result picture unexpectedly can where is out of control!!! ??
 cstrings path; 
GetDlgItemText (IDC_EDIT1, path);
//CxImage * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CxImage image;
Image. The Load (path. GetBuffer (), CXIMAGE_FORMAT_UNKNOWN);
If (image. The IsValid ())
{
Image. The Draw (GetDlgItem (IDC_CXIMAGE) - & gt; GetDC () - & gt; GetSafeHdc (), X, Y);
}


CodePudding user response:

CodePudding user response:

Unlikely, used didn't find the problem

CodePudding user response:

refer to the second floor DRACULAX05 response:
is unlikely, with didn't find this problem before

The X and Y is negative beyond control shows, when I was very puzzled

CodePudding user response:

In front of the dc drawing call ExcludeClipRect ()

CodePudding user response:

reference 4 floor u011330815 response:
call in front of the dc drawing ExcludeClipRect ()

You mean the control of the partial cannot be drawn? Now I was solved with GDI to create bitmap memory, just don't understand the Draw function of the first parameter is ignored?
  • Related