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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Gradient Masks

Gradient Masks

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestionadobejsonarchitecture
1 Posts 1 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.
  • B Offline
    B Offline
    bmw5002
    wrote on last edited by
    #1

    I'm writing my own text ticker/scroller type thing that only needs the handle to a static control on a dialog or wherever, and the rest is completely self contained in the class, the timers dont need windows to process their events. Anyway I want to have the left and right edges of the scroller fade. So say the background was dark blue, and the text was white. The white text would fade to blue at the edges. Now from my photoshop experience, at first I thought, black-to-white gradient as a mask. But how would I accomplish that with the GDI? At first I thought alpha-blending, but I didnt see a way to use a grayscale gradient as the guide for transparency. So then I saw the MaskBlt function. So I'm thinking create a monochrome memory bitmap with gradients on either side, then use that as the mask and a color memory bitmap with the text as the source, and the destination would be the solid background color layer. Then I would BitBlt that to the static control. So my question is, would this theoretically work? Am I going in the right direction?

    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