graphics.DrawImage return generic error
-
hi all, i draw a image when i preview it its display ok but when i print with multiple page. on first page its drawimage correctly but after first page it return generic error. i really dont understand what happen here. i m using this to draw image.
Graphics graphics(pDC->GetSafeHdc());
Image myPNG(path);
if(myPNG.GetLastStatus()!=Ok)
{
return FALSE;
}
Gdiplus::Status stat;
stat = graphics.DrawImage(&myPNG, (INT)image_rect.left, (INT)image_rect.top, 300, 300);
return TRUE;thanks in advance.
-
hi all, i draw a image when i preview it its display ok but when i print with multiple page. on first page its drawimage correctly but after first page it return generic error. i really dont understand what happen here. i m using this to draw image.
Graphics graphics(pDC->GetSafeHdc());
Image myPNG(path);
if(myPNG.GetLastStatus()!=Ok)
{
return FALSE;
}
Gdiplus::Status stat;
stat = graphics.DrawImage(&myPNG, (INT)image_rect.left, (INT)image_rect.top, 300, 300);
return TRUE;thanks in advance.
-
Where in your application is this code being called? Is it inside your
OnDraw
function, or somewhere else? -
hi all, i draw a image when i preview it its display ok but when i print with multiple page. on first page its drawimage correctly but after first page it return generic error. i really dont understand what happen here. i m using this to draw image.
Graphics graphics(pDC->GetSafeHdc());
Image myPNG(path);
if(myPNG.GetLastStatus()!=Ok)
{
return FALSE;
}
Gdiplus::Status stat;
stat = graphics.DrawImage(&myPNG, (INT)image_rect.left, (INT)image_rect.top, 300, 300);
return TRUE;thanks in advance.
Sadly, that Generic Error is the ONLY error provided by GDI+, so debugging them can be a nightmare. Good luck.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
i m used it in
OnPrint(CDC* pDC, CPrintInfo* pInfo) function,
i really dont understand when i preview this image is visible when i print these page ,on first page its print after first page return Generic Error on drawimage function.
-
The only thing you can do is to step through it in the debugger to try and isolate what is happening.
-
is there any role of PageUnit or PageScale, i u using graphics.SetPageUnit(UnitPixel); coz when i debug i dint recongze the problem, in preview the image is display and when i print the error comes. function is same for both.