256 Color bitmap 
Author Message
 256 Color bitmap

I have a problem displaying a 256 color bitmap in my BPW program. When
I run the program, it shows my 256 color bitmap in 16 colors (or so I
think). Can anyone explain how to let the bitmap appear in 256 colors,
or explain what I am doing wrong?
My second problem is with the InvalidateRect.  When I do the
InvalidateRect (to let disappear the bitmap), the listboxes in my
program lose their frames and backgroundcolor.

This is a piece of my code:

procedure ShowSplashScreen(var R: TRect);
var
  BM: HBitmap;
  DC, MemDC: HDC;
  BitInfo: TBitmap;
begin
  DC := GetDC(0);
  MemDC := CreateCompatibleDC(DC);
  BM := LoadBitmap(HInstance, 'Splash');

  BM := SelectObject(MemDC, BM);   { swap BMs}
  R.Left := GetDeviceCaps(DC,HORZRES) div 2 - BitInfo.bmWidth div 2;
  R.Top  := GetDeviceCaps(DC,VERTRES) div 2 - BitInfo.bmHeight div 2;
  BitBlt(DC, R.Left, R.Top, BitInfo.bmWidth, BitInfo.bmHeight,
         MemDC, 0, 0, SrcCopy);
  DeleteObject(SelectObject(MemDC, BM));
  DeleteDC(MemDC);
  ReleaseDC(0, DC);
  R.Right := R.Left + BitInfo.bmWidth;
  R.Bottom := R.Top + BitInfo.bmHeight;
end;

{Main Program}

VAR Control_App : TControl_App;
    R : TRect;

BEGIN

  ShowSplashScreen(R);
  Control_App.Init ('QPhone');

  Control_App.Run;
  Control_App.Done;

END.

I would be very pleased with any hint or help.

Axel Meerschaert



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. 256 color bitmap in windows

2. 256 Color Bitmap becomes Grayish in Win95

3. 256 color image on a 16 color screen?

4. 24-bit color to 256 color's source

5. Problem printing color bitmap on color printer wih TPW 1.5

6. Delphi: 16 color bitmap w/non-system colors

7. How do I print 256 color graphics?

8. Please Help : 256 color and Mouse

9. 256 color turbo pascal .tpi

10. TPW: loading 256 color bitmaps?

11. RGB and 256-color palette matching

12. 256 Color Mode

 

 
Powered by phpBB® Forum Software