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. drawing to a bitmap in memory

drawing to a bitmap in memory

Scheduled Pinned Locked Moved C / C++ / MFC
graphicscsharpc++mobileperformance
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.
  • U Offline
    U Offline
    User 1516551
    wrote on last edited by
    #1

    hi, for a uni project i need to write some c++ allowing a user to draw to a memory structure - like a bitmap i guess - so that the value of each individual pixel can accessed. initially this will be using the mouse and will be displayed on the screen but will later needs to work on a graphics tablet also displaying the output on the tablet. I have tried a couple of different approaches: FLTK - using mouse i can draw pictures but is not drawing to a data structure but instead to the screen so dont know how to access each pixel individually... have also tried using CBitmaps but cant work out how to draw to them... ive never programmed in c++ before so do not know what is possible. I am using .NET 2003 as an environment. please could someone suggest a way of doing this or somewhere to find information on it. Thanks in advance Andy

    A 1 Reply Last reply
    0
    • U User 1516551

      hi, for a uni project i need to write some c++ allowing a user to draw to a memory structure - like a bitmap i guess - so that the value of each individual pixel can accessed. initially this will be using the mouse and will be displayed on the screen but will later needs to work on a graphics tablet also displaying the output on the tablet. I have tried a couple of different approaches: FLTK - using mouse i can draw pictures but is not drawing to a data structure but instead to the screen so dont know how to access each pixel individually... have also tried using CBitmaps but cant work out how to draw to them... ive never programmed in c++ before so do not know what is possible. I am using .NET 2003 as an environment. please could someone suggest a way of doing this or somewhere to find information on it. Thanks in advance Andy

      A Offline
      A Offline
      Andy Hunter
      wrote on last edited by
      #2

      Do you need to access each pixel individually or just what the user draws? If it is just what is draws and you want it realtime then you can create a shadow bitmap and mirror the drawing logic both on the screen and this bitmap(or whatever device context you wish). If it is only after the user finishes and lets say selects print you could use something like the BitBlt function and copy the drawing area (most likely the client area of the window ) to whatever device context you wish. If you look on MSDN for GDI functions you will find all this information. I am not trying to be vague, I just am not exactly sure what you want to do; maybe if you would rephrase your question I could help more.

      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