Hi,

I'm implementing irregular shaped Windows Forms using the Region property in
.Net 2.0 (I'm not using TransparentKey to account for color depths > 16bpp)

I build the region mask adding 1 pixel high rectangles until all the area I
want to be transparent is covered (this tecnique is presented in several
Internet sites)

Everything works perfectly in XP and Vista. But not in Windows 2000. In
Win2K some areas (not all) of the transparent mask seem to be ignored. I have
compared the list of rectangles built in XP and 2000, and the region is built
exactly the same way. For some reason, Win2K (SP4) renders it differently
than what it should.

Does anyone know of any way to fix this?


Thanks,
Antonio

RE: Form Transparent areas, regions and Windows 2000 by CiaranODonnell

CiaranODonnell
Fri Jan 26 06:50:01 CST 2007

I dont know the answer to the question as I never used this technique on
Windows 2000 but I had it working on NT4 and XP.
One piece of advise though is to not use rectangles 1x1 pixel but make them
as wide as you can by looking ahead before to add/remove them from the
region. You may be doing this already but I thought i'd mention it as I used
to get exceptions occasionaly when using 1x1 rectangles

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com


"Antonio Bruno" wrote:

> Hi,
>
> I'm implementing irregular shaped Windows Forms using the Region property in
> .Net 2.0 (I'm not using TransparentKey to account for color depths > 16bpp)
>
> I build the region mask adding 1 pixel high rectangles until all the area I
> want to be transparent is covered (this tecnique is presented in several
> Internet sites)
>
> Everything works perfectly in XP and Vista. But not in Windows 2000. In
> Win2K some areas (not all) of the transparent mask seem to be ignored. I have
> compared the list of rectangles built in XP and 2000, and the region is built
> exactly the same way. For some reason, Win2K (SP4) renders it differently
> than what it should.
>
> Does anyone know of any way to fix this?
>
>
> Thanks,
> Antonio

RE: Form Transparent areas, regions and Windows 2000 by AntonioBruno

AntonioBruno
Fri Jan 26 12:05:00 CST 2007


Thanks Ciaran. I'm in fact doing that already.

It's interesting also that you say it works on NT, I haven't tested it but
somehow I expected that the behaviour in NT would be the same as Win2K.

--
Regards

Antonio


"Ciaran O''Donnell" wrote:

> I dont know the answer to the question as I never used this technique on
> Windows 2000 but I had it working on NT4 and XP.
> One piece of advise though is to not use rectangles 1x1 pixel but make them
> as wide as you can by looking ahead before to add/remove them from the
> region. You may be doing this already but I thought i'd mention it as I used
> to get exceptions occasionaly when using 1x1 rectangles
>
> --
> Ciaran O''Donnell
> http://wannabedeveloper.spaces.live.com
>
>
> "Antonio Bruno" wrote:
>
> > Hi,
> >
> > I'm implementing irregular shaped Windows Forms using the Region property in
> > .Net 2.0 (I'm not using TransparentKey to account for color depths > 16bpp)
> >
> > I build the region mask adding 1 pixel high rectangles until all the area I
> > want to be transparent is covered (this tecnique is presented in several
> > Internet sites)
> >
> > Everything works perfectly in XP and Vista. But not in Windows 2000. In
> > Win2K some areas (not all) of the transparent mask seem to be ignored. I have
> > compared the list of rectangles built in XP and 2000, and the region is built
> > exactly the same way. For some reason, Win2K (SP4) renders it differently
> > than what it should.
> >
> > Does anyone know of any way to fix this?
> >
> >
> > Thanks,
> > Antonio