Re: Transparent Blit with NT4
From: svrsig (chris_at_sandt.freeuk.com)
Date: 02/23/05
- Next message: Mike D Sutton: "Re: Transparent Blit with NT4"
- Previous message: svrsig: "Re: Transparent Blit with NT4"
- In reply to: svrsig: "Re: Transparent Blit with NT4"
- Next in thread: Mike D Sutton: "Re: Transparent Blit with NT4"
- Reply: Mike D Sutton: "Re: Transparent Blit with NT4"
- Messages sorted by: [ date ] [ thread ]
Date: 23 Feb 2005 11:09:21 -0800
svrsig wrote:
> Mike D Sutton wrote:
> > > I have tried this and find a problem - it works OK on Windows
> Millenium
> > > Edition but does not appear to work under Windows XP, with the
> > > transparent colour set to &00FFFFFF (white). I have created a
> bitmap
> > > with several areas of white, the inside of text characters, the
> > > surrounding background and the inside of a square box. Only the
> white
> > > area inside the square box is recognised as 'background' and thus
> has
> > > white pixels in the mask 'Create mask based on transparent key
> colour'.
> > >
> > > The bit map is created using the following (using BBCBASIC for
> Windows)
> > > and may be examined on the internet at
> > > http://www.homepages.gotadsl.co.uk/~signals/Test.bmp
> > > and the mask bitmap (in 24 bit colour not monochrome but created
> > > monochrome and converted) at
> > > http://www.homepages.gotadsl.co.uk/~signals/MaskXP.bmp
> > > with the correct result obtained under Windows ME at
> > > http://www.homepages.gotadsl.co.uk/~signals/MaskME.bmp
> >
> > Since you're using a BASIC syntax language then you may find the
> ChromaBlt library on my site (effectively the same code
> > as I posted you to before, but written in VB6) may work better, I'm
> assuming for the time being that there may be a bug
> > in your conversion of the code since this code has been in
production
> for years now on many OS' including Win2K and ME
> > without problems. If this still doesn't help then post back here
and
> I'll have another look through it, to be honest
> > though I can't see why (or how) you would be getting the results
you
> do, if it were a colour dithering problem then it
> > would affect the square too.. Are you by any change re-drawing the
> square onto the background before calling the
> > method?
>
> Pretty sure I'm not - I have tested it on Windows ME, works fine, and
> identical programme on Windows XP on both a portable and a desktop
and
> it fails in the way described on both.
>
> > Also, how are you creating the bitmap you're drawing from, and what
> screen bit-depth are you running at?
> > Hope this helps,
> >
> > Mike
> >
> > P.s. If you need to post more screenshots then could you either use
a
> compressed format (RLE compressed Bitmaps would
> > even suffice for this flat blocks of colour) or zip them up - The
> three images you posted were 11.2mb but compress down
> > to a _17kb_ .ZIP file which is a lot quicker to download! Cheers
;)
> >
> >
> > - Microsoft Visual Basic MVP -
> > E-Mail: EDais@mvps.org
> > WWW: http://EDais.mvps.org/
>
> Running at a screen depth of 32bits, the bitmap is created using
> PROCinit (the lines of BASIC listed above) and is the 'bmp' file
> 'Test.bmp'. It is created as a bitmap in the DC corresponding to
> inSrcDC. Presumably if you applied your ChromaBlt function to this
> bitmap it would work under Windows ME (as stated) but would fail
under
> Windows XP. The only thing I can think of is that the square is
> created using paths immediately beforehand (the rest being drawn
> directly), but the documentation says that the path used to create
the
> square is destroyed by the 'Strokeandfillpath' API anyway.
>
> For completeness (and to show it is NOT a transcription error) here's
> the rest of the programme:
>
> PROCinit:REM creates bitmap in d_context% using paths for the
box
> REM and direct drawing for the rest
> op_copy%=&CC0020
> SYS "CreateCompatibleDC",d_context% TO maskDC%
> SYS "CreateCompatibleDC",d_context% TO spriteDC%
> SYS "CreateBitMap",1600,1200,1,1,0 TO maskBMP%
> SYS "CreateCompatibleBitmap",d_context%,1600,1200 TO spriteBMP%
> SYS "SelectObject",maskDC%,maskBMP% TO oldmaskBMP%
> SYS "SelectObject",spriteDC%,spriteBMP% TO oldspriteBMP%
> :
> SYS "BitBlt",spriteDC%,0,0,1600,1200,d_context%,0,0,op_copy%
> PROCsaveasbitmap(spriteBMP%,"Test.bmp")
> REM Make a copy of the source image
> :
> SYS "SetBkColor",spriteDC%,&00FFFFFF
> REM set the 'transparent' colour
> :
> SYS "BitBlt",maskDC%,0,0,1600,1200,spriteDC%,0,0,op_copy%
> REM create mask based on transparent colour
> PROCsaveasbmp(maskBMP%,"MaskXP.bmp")
> :
> REM That's enough it has already gone wrong on XP but works on
> ME....
>
>
> Help.......
Further update as a thought dawned on me. Setting the RADEON 9600
series display setting on my desktop from 32bit colour to 16 bit colour
and re-running the programme (still under Windows XP) and the correct
result is obtained. Hmmm. Shouldn't it work whatever the display
setting?
Does this help?
- Next message: Mike D Sutton: "Re: Transparent Blit with NT4"
- Previous message: svrsig: "Re: Transparent Blit with NT4"
- In reply to: svrsig: "Re: Transparent Blit with NT4"
- Next in thread: Mike D Sutton: "Re: Transparent Blit with NT4"
- Reply: Mike D Sutton: "Re: Transparent Blit with NT4"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|