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. CStatic Drawing

CStatic Drawing

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpwinforms
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.
  • J Offline
    J Offline
    Jagadeesh VN
    wrote on last edited by
    #1

    Hi, I am having some problems with drawing a transparent bitmap into a CStatic derived object. I am drawing inside the OnPaint handler using Graphics ( GDI+ ) object. Since Its a transparent image, the first time when the control is drawn, I am getting the image properly. From next time onwards, when OnPaint in invoked, I am getting a black border for the image, which becomes thicker and thicker as the OnPaint in invoked ( I have to call Invalidate in Mouse over). Graphic object is attached to a Bitmap object and thats Bitmap object is used to draw to the CDC using DrawImage function. when I saved that Bitmap to a file, the image looks alright. So I guess its the DC of the CStatic control which is crating the problem. Also this CStatic control is placed in CDialog, and whenever, the dialog is minimized and restored, the image will be rendered correctly. I would appreciate any help on this behaviour. Looking forward for an answer Thanks Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."

    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