png transparency

  • Thread starter Thread starter jg
  • Start date Start date
J

jg

I have 2 png images each with one drawn black rectangle.
I I display tem on classic compact framework they intersect with each other.

If I display them on compact framework they cover each other.

Why?
 
Hi,

The .NET CF doesn't support transparency.

Hey Microsoft guys, are you keeping count how many times the word
transparency pops up in this newsgroup? Take a hint!


Regards,

Elisa
 
If you are drawing the image directly yourself you can apply an
ImageAttribute to define the colour value in the image which you wish to
"ignore" in this way you can exclude certain areas of the image from being
drawn. However with a PictureBox or similar you cannot have a transparent
image where the underlying form or control is visible.

Peter
 
Hi Elisa,

As Peter mentions below, transparency is supported on the .NET Compact
Framework when using Graphics to draw the images explicitly. To make a
blanket statement that it is not supported at all is a bit misleading,
especially given the general nature of the original post. I also want to
reassure you that we are listening to input/requests from this newsgroup and
that this feedback does help drive feature sets for future releases.

I will forward your concerns on to the team.

2.4. How do I draw an image with transparency?
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx#2.4

--
Geoff Schwab
Program Manager
Excell Data Corporation
http://msdn.com/mobility
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi,

Dixit Geoff [MSFT]: "...transparency is supported on the .NET Compact
Framework when using Graphics to draw the images explicitly."

Dixit Serg Kuryata [MS]: "As you may know, Windows CE does not support
transparent images and because of this fact, when imgdcmp.dll loads a
transparent image, it replaces the transparent color with the White color."

Q. How to use transparent images on a button?
A. Write your own custom control

Q. How to use transparent images in a ListView?
A. Write your own custom control

Q. How to use transparent images in a PictureBox?
A. Write your own custom control

Etc.

For those of you who honestly believe transparency is supported,
populate an ImageList with some random images, add the ImageList to a
ListView, and add some items with some random Text. Finally, change the
BackColor of the ListView. Convinced now?

Want transparency? Write your own custom controls, and use the
ImageAttributes param. Does that count as ".NET CF supports
transparency"? Come on!!!


Regards,

Elisa
 
Sorry to side with Microsoft on this, but yes, in my book that does mean
transparency is supported. It's there and usable, just not simple. Not
supported, IMHO, means "can't be done" like callbacks from unmanaged code or
"not without significan P/Invocation" like saving a Bitmap.

Keep in mind that Microsoft was targeting an audience much larger than just
yourself when they wrote the CF, and history has borne out repeatedly that
it's truly impossible to please everyone all the time. Me, I could care
less about transparency. It has not affected me yet, so to me it's a very
low priority issue. I'd much rather have callbacks and better thread
support.

Everyone has their needs and I'm certain the CF team is doing all they can
to fulfill them, but they don't have an infinite number of monkeys typing on
an infinite number of keyboards. I think for a version 1 product they did
pretty well.
 
Hi Chris,
Sorry to side with Microsoft on this, but yes, in my book that does mean
transparency is supported. [...] Not supported, IMHO, means "can't be done"

Sorry if this is getting slightly off-topic, but this morning during our
project meeting our team had just such a great laugh with your book's
interpretation of the word "SUPPORTED" as "it CAN be done", I couldn't
resist.

If your book hasn't been published yet, feel free to use any of the
examples below to illustrate your definition of "SUPPORTED".

+ "Our application supports resolutions upto 4096x4096 pixels"
- Ok, our forms still are 240x320 pixels so you'd need binoculars, but
it CAN be done.

+ "Our company supports the starving children all over the world"
- We don't actual make any contributions, but on the other hand, we
don't actively prevent these children from eating either. Supported
simply means: it CAN be done!

+ "Our PDA supports a battery life of 50 years"
- Well, there aren't any such batteries on the market, but if they'd
ever appear, our PDA supports them, it CAN be done.

+ "We support every initiative to create secure and robust applications"
- In reality, we couldn't care less, support simply means: it CAN be done.

+ "Our Framework supports transparency"
- Ah, it doesn't actually come with ANY controls that support
transparency, but you're welcome to write every control yourself, it CAN
be done.

All joking aside, for those who believe "SUPPORT" means a more active
involvement than Microsoft's and Chris's passive interpretation, visit
http://www.care.org, and REALLY support the starving children all over
the world!


Regards,

Elisa
 
Hi Chris,
Sorry to side with Microsoft on this, but yes, in my book that does mean
transparency is supported. [...] Not supported, IMHO, means "can't be done"

Sorry if this is getting slightly off-topic, but this morning during our
project meeting our team had just such a great laugh with your book's
interpretation of the word "SUPPORTED" as "it CAN be done", I couldn't
resist.

If your book hasn't been published yet, feel free to use any of the
examples below to illustrate your definition of "SUPPORTED".
<snip>

*LOL* :-D

Humor is, if you keep on laughing ;-)

I really fell with you. Of course, transparency is support by the "System"
(i can draw one bitmap above an other with a transparent color) - but not
by any of the standard controls.

No one has the time to write all standard-control AGAIN just to have
transparency.

AND: someone should define "transparency"... what does it mean if it is
"supported"?

a) There is code with which you can draw bitmaps onto other bitmaps and
left out a specific color (that's what we have)

b) Use Bitmaps as Icons or something in ListView/-Boxes/-etc... and use a
given color as transparent color so that the underlaying control(color)
will be visible? (that's what many of us need/like to have)

b2) ...an read use the transparent-information of the file (GIF, PNG)...

c) When you use a background-image for the whole form - then let this image
shine thru controls - so Labels, Radio-buttons, checkboxes etc. will not
cover a rectangle but just draw the control and the text.... (when will we
get this?)

c2) define a % value for transparency so that a panel could cover the
background 50% for example (which is alphachanel-transparency) (which would
be cool and maybe usefull for some applications but i don't think it's a
top priority?)


Really hard to read "can be done! just write your own control" more
often...
....because then the answere could be: "can be done! use C++ (where it is
supported)" .. or "can be done! use C++ and write your own system from
scratch" :-)

Boris (who has written his first owner-draw-listbox - still without
columns)
 
I have to support Elisa on this case. The problem with transparency
has come up too many time in the forum and in my project. I know
microsoft doesn't have infinite time nor resource and can't make
everyone happy, but not having this features at least for me has been
a pain.
 
Not sure what book you're talking about. I'm not writing a book, nor do I
plan on it. In fact I turned down the request.

Yes, transparency support is very limited and could be improved greatly, but
there have been several examples posted that use transparency without
resorting to P/Invoke. If you can get a transparent color without
P/Invoking, is seems to me that would be "support" for transparency on some
level.

Now is that level enough to do what everyone wants? Obviously not. Many
people have been frustrated with the limitation. But look for example at
serial port access. If your core business is writing apps for industrial
controllers, you're not going to care about transparency, but serial
communication is critical. The only way to use a serial port from managed
code is by writing a *lot* of P/Invoke code. That is what I call "not
supported".

So if you had limited resources and could implement one feature, either
transparency or serial communication support, which would you add? In your
case, probably transparency. For others it would be the serial port. Many
decisions like this had to be made during the development process of the CF.
Thinking that because your specific feature ended up on the losing end of
one of those decisions in v 1.0 and wasn't implemented somehow means that
Microsoft is either completely inept or maliciously trying to sabotage your
project by making you do extra work is laughable.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Elisa said:
Hi Chris,
Sorry to side with Microsoft on this, but yes, in my book that does mean
transparency is supported. [...] Not supported, IMHO, means "can't be
done"

Sorry if this is getting slightly off-topic, but this morning during our
project meeting our team had just such a great laugh with your book's
interpretation of the word "SUPPORTED" as "it CAN be done", I couldn't
resist.

If your book hasn't been published yet, feel free to use any of the
examples below to illustrate your definition of "SUPPORTED".

+ "Our application supports resolutions upto 4096x4096 pixels"
- Ok, our forms still are 240x320 pixels so you'd need binoculars, but
it CAN be done.

+ "Our company supports the starving children all over the world"
- We don't actual make any contributions, but on the other hand, we
don't actively prevent these children from eating either. Supported
simply means: it CAN be done!

+ "Our PDA supports a battery life of 50 years"
- Well, there aren't any such batteries on the market, but if they'd
ever appear, our PDA supports them, it CAN be done.

+ "We support every initiative to create secure and robust applications"
- In reality, we couldn't care less, support simply means: it CAN be done.

+ "Our Framework supports transparency"
- Ah, it doesn't actually come with ANY controls that support
transparency, but you're welcome to write every control yourself, it CAN
be done.

All joking aside, for those who believe "SUPPORT" means a more active
involvement than Microsoft's and Chris's passive interpretation, visit
http://www.care.org, and REALLY support the starving children all over
the world!


Regards,

Elisa
 
Back
Top