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. Dynamically updating image (PNG)

Dynamically updating image (PNG)

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studioquestionannouncementlearning
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.
  • D Offline
    D Offline
    Don Guy
    wrote on last edited by
    #1

    Hello there, I am working on a Windows application using Visual Studio 2012. One of the screens have a text entry field for the user. Instead of using a standard text field control, am placing a image which looks exactly like a text field. Now what i want to do is, capture the key stroke and update this image with the characters entered by user. The initial image shown to the user is "Blank_Text_Entry.png" and this is added to the resource as IDB_BLANK_TEXT_ENTRY. This is a rectangular white image with dimensions 153 x 27, with a size of 250 bytes. My goal is to be able to update this image dynamically based on key strokes by user and display it. Is it possible to do something like this? If yes, can anyone share some sample code? Thanks in advance.

    A 1 Reply Last reply
    0
    • D Don Guy

      Hello there, I am working on a Windows application using Visual Studio 2012. One of the screens have a text entry field for the user. Instead of using a standard text field control, am placing a image which looks exactly like a text field. Now what i want to do is, capture the key stroke and update this image with the characters entered by user. The initial image shown to the user is "Blank_Text_Entry.png" and this is added to the resource as IDB_BLANK_TEXT_ENTRY. This is a rectangular white image with dimensions 153 x 27, with a size of 250 bytes. My goal is to be able to update this image dynamically based on key strokes by user and display it. Is it possible to do something like this? If yes, can anyone share some sample code? Thanks in advance.

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      You can sure do that... but it seems WAY more painful than taking a text control and adapting it to do whatever it is you want. If I may ask, why is it that you want to draw it yourself rather than changing an existing field control? BTW, the way you would do it is by custom drawing using something like GDI. Easiest way would be to draw the blank entry box first, then update it with textual line items... problem is making it look and act nice would be a pain.

      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