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. CImage::StretchBlt does not work!?

CImage::StretchBlt does not work!?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • S Offline
    S Offline
    schaereran gmx net
    wrote on last edited by
    #1

    I have a problem with the CImage::StretchBlt Function! I made a little application, based on the "SimpleImage" -Sample Application from Microsoft. I tryed to stretch a picture to the screen (dynamic..) in the OnPaint() Function i have the following line: m_imgOriginal.StretchBlt(dc,0,0,m_imgOriginal.GetWidth()*dFactor, m_imgOriginal.GetHeight()*dFactor, SRCCOPY); dFactor is a Factor, calculated earlier. so the problem is, when dFactor is higher than 1 everithing looks fine, the picture is stretched properly. but when the factor is below 1, the picture looks very poor and distorted! is there a sloution to the problem? is it possible to make a CImage-Picture smaller at all without distorting it?? thanx for any input!!

    R 1 Reply Last reply
    0
    • S schaereran gmx net

      I have a problem with the CImage::StretchBlt Function! I made a little application, based on the "SimpleImage" -Sample Application from Microsoft. I tryed to stretch a picture to the screen (dynamic..) in the OnPaint() Function i have the following line: m_imgOriginal.StretchBlt(dc,0,0,m_imgOriginal.GetWidth()*dFactor, m_imgOriginal.GetHeight()*dFactor, SRCCOPY); dFactor is a Factor, calculated earlier. so the problem is, when dFactor is higher than 1 everithing looks fine, the picture is stretched properly. but when the factor is below 1, the picture looks very poor and distorted! is there a sloution to the problem? is it possible to make a CImage-Picture smaller at all without distorting it?? thanx for any input!!

      R Offline
      R Offline
      RaajaOfSelf
      wrote on last edited by
      #2

      Try doing this , SetStretchBltMode(destDC,HALFTONE); where destDC is teh destination DC

      S 1 Reply Last reply
      0
      • R RaajaOfSelf

        Try doing this , SetStretchBltMode(destDC,HALFTONE); where destDC is teh destination DC

        S Offline
        S Offline
        schaereran gmx net
        wrote on last edited by
        #3

        very cool! now it works! thanx a lot!

        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