Solved

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

Posted on 2007-11-19
3
546 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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