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. rotating transparent bitmap causes a halo of transparent color around bitmap

rotating transparent bitmap causes a halo of transparent color around bitmap

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
2 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.
  • Y Offline
    Y Offline
    yoshibebe
    wrote on last edited by
    #1

    When I rotate a transparent bitmap, the transparent background color will be drawn around the bitmap (a one pixel halo). This doesn't happen when the rotation is horizontal or vertical. I am doing the following masking: BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMaskDC, 0, 0, SRCAND ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); At this point I have no clue as to why something like this would occur, because I have rotated the whole bitmap and saved it into the DC's. Has this happened to anyone before? Thanks!

    C 1 Reply Last reply
    0
    • Y yoshibebe

      When I rotate a transparent bitmap, the transparent background color will be drawn around the bitmap (a one pixel halo). This doesn't happen when the rotation is horizontal or vertical. I am doing the following masking: BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMaskDC, 0, 0, SRCAND ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); At this point I have no clue as to why something like this would occur, because I have rotated the whole bitmap and saved it into the DC's. Has this happened to anyone before? Thanks!

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Sounds like your rotation code is causing your mask to degrade, so that the transparent colour where it is next to another colour is slightly changed. Have you verified that the pixels in question are EXACTLY the background colour, and not off by one or two ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
      C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
      Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      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