?
Solved

How to make getpixel on an image, but not from a picturebox?

Posted on 2007-11-19
3
Medium Priority
?
554 Views
Last Modified: 2012-05-05
We have a VB6 soft that analizes pixels, I found that GetPixel API or VB Point "create" color pixels on a PictureBox where there are only black pixels, on half the PCs our soft is installed. It´s fundamental for us to discriminate black from color pixels. We reduced the possible problems and got to the conclusion that VB PictureBox is not working properly, so we need the code to create a DC and loop through the pixels usiing API. We work with the numbers, don´t need to show the pixels.
0
Comment
Question by:cyberproject
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 1500 total points
ID: 20319623
Create a DIB array from Picture and you can step through the array to analyze or modify color bits.

Using DIB Sections in VB:
http://www.vbaccelerator.com/codelib/gfx/dibsect.htm

Count Unqiue Colors Quickly:
http://www.freevbcode.com/ShowCode.asp?ID=6999 
0
 

Author Comment

by:cyberproject
ID: 20336187
Thanks, this is possibly the way, the problem is my image is an EMF file, so to get the data I'am doing a PlayEnhMetaFile over a picturebox, because that API needs an hDC. The code you sent (till what I understood) needs a Loadpicture, that is a stdPicture which has no hDC.
What I need is to analize that pixels of the EMF file I have, Any ideas?
0
 

Author Comment

by:cyberproject
ID: 20343815
I found that the problem was not VB PictureBox but ClearType antialiasing over metafiles (EMF), this generates colors that surround tha black text for better readability, this color pixels appear with any method of pixel analizing. The only thing I can do right now to fix it is to disable Cleartype.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question