Click here to Skip to main content
15,908,776 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Copy Excel Data into Access Database Table. Pin
jeshra27922-May-10 5:40
jeshra27922-May-10 5:40 
GeneralRe: Copy Excel Data into Access Database Table. Pin
DaveAuld22-May-10 20:48
professionalDaveAuld22-May-10 20:48 
GeneralRe: Copy Excel Data into Access Database Table. Pin
jeshra27923-May-10 18:53
jeshra27923-May-10 18:53 
QuestionCompare two scanned images! Pin
FeRtoll21-May-10 8:26
FeRtoll21-May-10 8:26 
AnswerRe: Compare two scanned images! Pin
Dave Kreskowiak21-May-10 9:15
mveDave Kreskowiak21-May-10 9:15 
GeneralRe: Compare two scanned images! Pin
FeRtoll21-May-10 11:42
FeRtoll21-May-10 11:42 
GeneralRe: Compare two scanned images! Pin
FeRtoll21-May-10 13:34
FeRtoll21-May-10 13:34 
GeneralRe: Compare two scanned images! Pin
Dave Kreskowiak22-May-10 14:45
mveDave Kreskowiak22-May-10 14:45 
Pf course your search is slow! First, you're using GetPixel, which takes an eternity to execute. Second, this code is garbage:
CheckPixel = (System.Math.Sqrt((Val(source_color.R.ToString) - Val(search_color.R.ToString)) * (Val(source_color.R.ToString) - Val(search_color.R.ToString)) + (Val(source_color.G.ToString) - Val(search_color.G.ToString)) * (Val(source_color.G.ToString) - Val(search_color.G.ToString)) + (Val(source_color.B.ToString) - Val(search_color.B.ToString)) * (Val(source_color.B.ToString) - Val(search_color.B.ToString))) > sense)


Your converting each RGB value component, say R, to a string, then back to a value. This is VERY time consuming an completely unnecessary. Not only are you doing it at all, you're doing it several times for each time you use the same value!

The only way you're going to improve performance is to scrap this code and rewrite it in C# and directly access the image data. You cannot do this in VB.NET because it requires the use of unsafe pointers, which VB.NET does not support.

Search the articles for "image processing for dummies" and you'll find a very good series of articles by Christian Graus explaining just how this is done.

A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008
But no longer in 2009...




GeneralRe: Compare two scanned images! Pin
FeRtoll23-May-10 0:07
FeRtoll23-May-10 0:07 
GeneralRe: Compare two scanned images! Pin
FeRtoll23-May-10 10:33
FeRtoll23-May-10 10:33 
GeneralRe: Compare two scanned images! Pin
Dave Kreskowiak23-May-10 18:08
mveDave Kreskowiak23-May-10 18:08 
GeneralRe: Compare two scanned images! Pin
FeRtoll23-May-10 22:12
FeRtoll23-May-10 22:12 
Questioninfragistics ultrawingrid tabbing problem Pin
soterios21-May-10 3:22
soterios21-May-10 3:22 
AnswerRe: infragistics ultrawingrid tabbing problem Pin
Dave Kreskowiak21-May-10 6:57
mveDave Kreskowiak21-May-10 6:57 
QuestionCD (data or music) or DVD Pin
JR21221-May-10 0:10
JR21221-May-10 0:10 
AnswerRe: CD (data or music) or DVD Pin
JHizzle21-May-10 0:46
JHizzle21-May-10 0:46 
AnswerRe: CD (data or music) or DVD Pin
DaveAuld21-May-10 0:51
professionalDaveAuld21-May-10 0:51 
AnswerRe: CD (data or music) or DVD Pin
Baconbutty21-May-10 2:58
Baconbutty21-May-10 2:58 
GeneralRe: CD (data or music) or DVD Pin
Luc Pattyn21-May-10 3:08
sitebuilderLuc Pattyn21-May-10 3:08 
QuestionPercentage Pin
Syasyaaa20-May-10 19:52
Syasyaaa20-May-10 19:52 
AnswerRe: Percentage Pin
Andy_L_J20-May-10 20:12
Andy_L_J20-May-10 20:12 
AnswerRe: Percentage Pin
Dalek Dave20-May-10 21:10
professionalDalek Dave20-May-10 21:10 
AnswerRe: Percentage Pin
The Man from U.N.C.L.E.21-May-10 2:19
The Man from U.N.C.L.E.21-May-10 2:19 
QuestionText Not Showing Fine Pin
Anubhava Dimri20-May-10 19:32
Anubhava Dimri20-May-10 19:32 
AnswerRe: Text Not Showing Fine Pin
DaveAuld20-May-10 19:37
professionalDaveAuld20-May-10 19:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.