Background colors invert when resizing?

This is a discussion on Background colors invert when resizing? within the Windows Programming forums, part of the Platform Specific Boards category; I just finished coding my first window that loads a bitmap for it's background. neat huh? Anyway, when I fire ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    22

    Question Background colors invert when resizing?

    I just finished coding my first window that loads a bitmap for it's background. neat huh? Anyway, when I fire up my program, sometimes the colors are right and other times they look inverted or something. My bitmap is a purple/black clouds thing. Sometimes, it's the original color and sometimes it's a green/black bitmap. And when it is the correct color and I maximize the window, the color changes. Any suggestions??
    I can't say for sure.....but that doesn't look work related.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,855
    What are the functions you are using?

    I assume you are using StretchBlt. Are you using

    SetDIBits(hdc,hBMP,0, iImageY,cImageBuffer,pbiImage,DIB_RGB_COLORS);

    and

    SetStretchBltMode(hdc,HALFTONE);

    Try to only use int multi's of the original image size for best results.

    I still had problems with StretchBlt() in release but not debug. (White (255) was drawn as black (0) and the other shades had one added to them)

    I think it was that the pallette was failing to align the brush but could not fix the problem with the API functions. I use another drawing lib and this solved the problem.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why I only get 8 colors out of ncurses?
    By Nazgulled in forum C Programming
    Replies: 3
    Last Post: 05-08-2007, 06:06 PM
  2. Windows background color
    By Exile in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2005, 06:55 AM
  3. XWindows background colors
    By Exile in forum Linux Programming
    Replies: 2
    Last Post: 01-22-2005, 05:05 PM
  4. Detect Close of a background process
    By Schwarzhelm in forum C Programming
    Replies: 1
    Last Post: 11-05-2003, 12:46 AM
  5. Edit Controls - Colors - Messages
    By G'n'R in forum Windows Programming
    Replies: 3
    Last Post: 09-28-2003, 05:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21