Click here to Skip to main content
15,921,179 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to change vb98 project to vb.net2005 project Pin
Paritos1-Mar-06 22:56
Paritos1-Mar-06 22:56 
Questioncopy macro into xls file Pin
lonely_life1-Mar-06 21:01
lonely_life1-Mar-06 21:01 
QuestionTreeview problem in vb.net Pin
pankajgarg121-Mar-06 20:25
pankajgarg121-Mar-06 20:25 
AnswerRe: Treeview problem in vb.net Pin
Dave Kreskowiak2-Mar-06 7:42
mveDave Kreskowiak2-Mar-06 7:42 
QuestionOpen a file when it is double clicked Pin
Chatura Dilan1-Mar-06 20:19
Chatura Dilan1-Mar-06 20:19 
AnswerRe: Open a file when it is double clicked Pin
noshaba mariam1-Mar-06 21:23
noshaba mariam1-Mar-06 21:23 
AnswerRe: Open a file when it is double clicked Pin
J4amieC1-Mar-06 21:53
J4amieC1-Mar-06 21:53 
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 1:12
Chatura Dilan2-Mar-06 1:12 
GeneralRe: Open a file when it is double clicked Pin
J4amieC2-Mar-06 1:16
J4amieC2-Mar-06 1:16 
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 14:13
Chatura Dilan2-Mar-06 14:13 
GeneralRe: Open a file when it is double clicked Pin
Omar Mallat2-Mar-06 2:02
professionalOmar Mallat2-Mar-06 2:02 
GeneralRe: Open a file when it is double clicked Pin
Chatura Dilan2-Mar-06 14:06
Chatura Dilan2-Mar-06 14:06 
QuestionHow to get the clients IP address using TcpClient in VB.Net Pin
Maher Abu Zer1-Mar-06 20:19
professionalMaher Abu Zer1-Mar-06 20:19 
AnswerRe: How to get the clients IP address using TcpClient in VB.Net Pin
Dave Kreskowiak2-Mar-06 5:35
mveDave Kreskowiak2-Mar-06 5:35 
AnswerRe: How to get the clients IP address using TcpClient in VB.Net Pin
Maher Abu Zer2-Mar-06 6:34
professionalMaher Abu Zer2-Mar-06 6:34 
GeneralRe: How to get the clients IP address using TcpClient in VB.Net Pin
Dave Kreskowiak2-Mar-06 7:37
mveDave Kreskowiak2-Mar-06 7:37 
QuestionTreeeview problem in vb.net Pin
pankajgarg121-Mar-06 20:09
pankajgarg121-Mar-06 20:09 
AnswerRe: Treeeview problem in vb.net Pin
Dave Kreskowiak2-Mar-06 5:08
mveDave Kreskowiak2-Mar-06 5:08 
Questioncreating multiple webcharts based upon query ID Pin
uglyeyes1-Mar-06 19:25
uglyeyes1-Mar-06 19:25 
AnswerRe: creating multiple webcharts based upon query ID Pin
Dave Kreskowiak2-Mar-06 4:50
mveDave Kreskowiak2-Mar-06 4:50 
Questioncode for thinning or skeletonization in vb Pin
swap_1231-Mar-06 19:18
swap_1231-Mar-06 19:18 
AnswerRe: code for thinning or skeletonization in vb Pin
Dave Kreskowiak2-Mar-06 4:20
mveDave Kreskowiak2-Mar-06 4:20 
QuestionVB Image Comparison Pin
Russ72841-Mar-06 16:36
Russ72841-Mar-06 16:36 
Okay here is what I want to do, I have an idea of how to do it but I am getting lost and my code is not helping me. I would like to take a grayscale image that is relatively dark and find the bright spots in it, say if I took a picture of the night sky, I would like to find all of the stars. I also want to find the center of each of these bright spots and log the x-y coordinates of them while putting a little red dot where the center of the white spot is, maybe 4px.

Here is what I have so far:
OpenPreviewWindow(lstDevices.SelectedIndex)
ToClipBoard()
ClosePreviewWindow(lstDevices.SelectedIndex)
Dim data As IDataObject
Dim bmap As Image
Data = Clipboard.GetDataObject()
If Data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then
    bmap = CType(Data.GetData(GetType(System.Drawing.Bitmap)), Image)
    imgCapture.Image = bmap
End If

Dim objGr As Graphics = imgCapture.CreateGraphics
Dim imgHDC As IntPtr = objGr.GetHdc
Dim arrPixels(235, 315)
Dim x, y As Integer

For x = 0 To 235
    For y = 0 To 315
        arrPixels(x, y) = GetPixel(imgHDC, x, y)
    Next
Next


Okay now that opens my camera, takes a snapshot, copies it to the clipboard, and closes the camera. The image is 320x240 and the loop gets the pixel color for each pixel. Now the problem with this code is that for a lot (75% or more) of the pixels it returns "-1" for the color, as if I am out of bounds on my x-y coords. The graphics object is to handle the .hDC in .NET 2005.

I want to know if there is a better way or faster way of going about this rather than pixel by pixel in a double loop scenario. Also I have no idea how to go about the second half of my program. Any help and example code will be greatly appreciated.

-Russ

-- modified at 22:43 Wednesday 1st March, 2006
AnswerRe: VB Image Comparison Pin
progload1-Mar-06 19:46
progload1-Mar-06 19:46 
GeneralRe: VB Image Comparison Pin
Russ72842-Mar-06 14:51
Russ72842-Mar-06 14:51 

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.