Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. graphics.DrawImage return generic error

graphics.DrawImage return generic error

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    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.

    L B 2 Replies Last reply
    0
    • L Le rner

      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.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Where in your application is this code being called? Is it inside your OnDraw function, or somewhere else?

      L 1 Reply Last reply
      0
      • L Lost User

        Where in your application is this code being called? Is it inside your OnDraw function, or somewhere else?

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • L Le rner

          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.

          B Offline
          B Offline
          Brisingr Aerowing
          wrote on last edited by
          #4

          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???

          1 Reply Last reply
          0
          • L Le rner

            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.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            The only thing you can do is to step through it in the debugger to try and isolate what is happening.

            L 1 Reply Last reply
            0
            • L Lost User

              The only thing you can do is to step through it in the debugger to try and isolate what is happening.

              L Offline
              L Offline
              Le rner
              wrote on last edited by
              #6

              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.

              L 1 Reply Last reply
              0
              • L Le rner

                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.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Sorry, but as I said, the only way to track this sort of error is by using your debugger. There is nothing that anyone here can do to assist, as there is no useful information provided.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups