Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-19
3
Medium Priority
?
562 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

Technology Partners: 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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

604 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