Click here to Skip to main content
15,911,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I check if icon is empty (the contents of it, the picture) in vb.net?
Please help, thanks in advance.
Posted
Comments
PIEBALDconsult 5-Apr-15 19:22pm    
Knock on it. If it sounds hollow, it might be empty.
Sergey Alexandrovich Kryukov 5-Apr-15 20:51pm    
Best algorithm so far... But are you sure you were talking about a picture? :-)
—SA
Sergey Alexandrovich Kryukov 5-Apr-15 20:50pm    
Define "empty" strictly. That's all.
—SA
iProgramIt 5-Apr-15 21:57pm    
I suppose, that it has nothing and is nothing. Because I have an icon extractor which loops 300 times. And the file I extract the icon from only has one Icon. So when I go to get the icon, it picks up 300 icons.
Sergey Alexandrovich Kryukov 5-Apr-15 22:07pm    
Wrong. If the icon is all filled with red, is it empty or not? Or black? Or white? Or does it have to be all transparent, 100% of pixel alpha being equal to 0? But such pixels could still have different colors, but fully transparent. Visually, its empty, but data is different. And so on. So, unless you define it, there is nothing to talk about.

Better yes, solve this problem yourself. Just check up every pixel using your criteria. What's the problem?

And, finally, I don't know how come you can end up having "empty" icon. In what real-life situation you can face such weird thing? Frankly, it makes no sense, it looks like. And who would like to spend time on something which makes no sense. Face it, if you have any non-null Icon (or other Image object), it is not empty, logically. This is because there is no any logical reason to consider one pixel better than any other.

—SA

1 solution

A picture cannot be empty- it is set of coordinates with position and colour information.
You could only check if it is all the same colour e.g white or black.
 
Share this answer
 
Comments
iProgramIt 5-Apr-15 19:03pm    
Or all transparent. So how would I do that?
Sergey Alexandrovich Kryukov 5-Apr-15 22:10pm    
What have you tried so far?
But more reasonable question would be: why? It really makes no sense.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900