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. what should be code for resizing the drawn image in pixels

what should be code for resizing the drawn image in pixels

Scheduled Pinned Locked Moved C / C++ / MFC
graphics
4 Posts 2 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.
  • K Offline
    K Offline
    kindd
    wrote on last edited by
    #1

    what should be code for resizing the image drawn(zoom in and zoom out)drawing in pixels

    Problems are to be solve

    P 1 Reply Last reply
    0
    • K kindd

      what should be code for resizing the image drawn(zoom in and zoom out)drawing in pixels

      Problems are to be solve

      P Offline
      P Offline
      Parthi_Appu
      wrote on last edited by
      #2

      kindd wrote:

      code for resizing the image drawn(zoom in and zoom out)

      Redraw the image with desired size. Say you have drawn the image 50,50 - 100,100 -- then to zoom in, draw the same image from 40,40 - 110,100 -- to zoom out, draw the same image from 60,60 - 90,90 You can use, BitBlt or StretchBlt from CDC class or DrawImage from GDI+ Image Class Hope i understood your question...


      Do your Duty and Don't expect the Result

      K 1 Reply Last reply
      0
      • P Parthi_Appu

        kindd wrote:

        code for resizing the image drawn(zoom in and zoom out)

        Redraw the image with desired size. Say you have drawn the image 50,50 - 100,100 -- then to zoom in, draw the same image from 40,40 - 110,100 -- to zoom out, draw the same image from 60,60 - 90,90 You can use, BitBlt or StretchBlt from CDC class or DrawImage from GDI+ Image Class Hope i understood your question...


        Do your Duty and Don't expect the Result

        K Offline
        K Offline
        kindd
        wrote on last edited by
        #3

        for a map to view clear by zoom in and zoom out, any thing further that helps in coding?

        nill

        P 1 Reply Last reply
        0
        • K kindd

          for a map to view clear by zoom in and zoom out, any thing further that helps in coding?

          nill

          P Offline
          P Offline
          Parthi_Appu
          wrote on last edited by
          #4

          kindd wrote:

          map to view clear by zoom in and zoom out

          Use CDC::StretchBlt Say pBitmap is your map and dc is your DC then,

          CDC cdc; cdc.CreateCompatibleDC(&dc);
          CBitmap* pOldBitmap = cdc.SelectObject(pBitmap);
          dc.StretchBlt(x, y, width, height, &cdc, sx, sy, swidth, sheight, SRCCOPY);
          cdc.SelectObject(pOldBirmap);
          cdc.DeletcDC();

          Here x,y,width,height are your destination rect, it will remain same for both zoom in and zoom out.But sx,sy,swidth,sheight are your source and it will vary for zoom in and zoom out and the specified source rect is what you have to zoom in/out...


          Do your Duty and Don't expect the Result

          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