dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: a simple problem with image processing

  1. #1
    Join Date
    Aug 2011
    Posts
    21

    Question a simple problem with image processing

    Hi all
    I am doing some work about image processing using c++ ;How can I draw a red rectangular in a 8 bit bmp file , I can set the pixel value to 255 to creat a rectangular , but it is not red ! can someone help me with this ,Thank you very much!
    Best wishes!

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: a simple problem with image processing

    You cannot do this. Possible solutions are to change pixel format or to keep this rectangle as overlay. Overlay information is kept outside of an image, and drawn over image when it is displayed.

  3. #3
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: a simple problem with image processing

    Quote Originally Posted by Angela2010 View Post
    Hi all
    I am doing some work about image processing using c++ ;How can I draw a red rectangular in a 8 bit bmp file , I can set the pixel value to 255 to creat a rectangular , but it is not red ! can someone help me with this ,Thank you very much!
    Best wishes!
    Can you please provide some more info:
    Is the bitmap a file or in memory?
    Which function are you using to "draw"?
    Why do you think that 255 should be red?
    AFAIK 255 in a 8bit bmp stands for the last color in the palette and not for red.

    Using gdi functions draw the color RGB(255,0,0) and not 255.

    Regards
    PA

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)