|
Hai ,
VB.NET
--------
Does anybody know how to do this,
i need to knw how to get a RGB values from a perticular image and put it to an three dimentional array using vb.Net
R G B R G B
62 12 85 125 190 104
25 2 135 205 120 95
42 25 145 180 166 75
95 32 193 175 145 115
this is the example of after cutting the image RGB values the array shoud like,
thank u,
suis
|
|
|
|
|
Here is one way to do it.
' Create a bitmap object from an image
Dim myBitmap As Bitmap = New Bitmap("Sunflowr.jpg")
' Get the Height and Width in pixels
Dim BitmapSize As Size = myBitmap.Size
' Holds the color of the pixel retieved from image
Dim PixelColor As Color
' 3-d Array to hold RGB values of color
Dim Rgb(BitmapSize.Width - 1, BitmapSize.Height - 1, 2) As Byte
For x As Integer = 0 To BitmapSize.Width - 1
For y As Integer = 0 To BitmapSize.Height - 1
PixelColor = myBitmap.GetPixel(x, y)
Rgb(x, y, 0) = PixelColor.R
Rgb(x, y, 1) = PixelColor.G
Rgb(x, y, 2) = PixelColor.B
Next
Next
|
|
|
|
|
Ok this is greate thnak u very much for u r time and help
thanks again.
i really appriate this.
suis
|
|
|
|
|
Please help me
i need to Take a set of images from a specified directory, and create a file containing colour histograms
computed from each of these images. The input images may be in any standard data format (such as
TIFF, GIF or JPEG).
how should i do this using vb.net
suis
|
|
|
|
|
Hi,
1. Open image: Dim b As Bitmap = new Bitmap("MyFile.bmp")
2. Get the color of one pixel: Dim c as Color = b.GetPixel(x, y)
3. Get the red/green/blue value from the color: Dim val As Integer = c.R/G/B
4. Count the needed values in some kind of loop
5. Write your results to a file (this can be done in various ways and depends on how your result output should look like)
|
|
|
|
|
Ok this is working nicely thnak u for u r help
suis
|
|
|
|
|
Read my C# image processing articles - if you can access the bitmap data in any way ( I'm not sure that you can, C# offers stuff VB.NET doesn't here ), then you should use those methods if you care at all about speed. Otherwise, do what he said
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am dealing with my own application (VB6 build) which uses specific visio files. from my application, i need to call a macro, which is runn from visio by double clicking a specific shape (with known ID & Name).
The problem is how to run this macro from my application, which is (the macro) is disabled in the visio.
|
|
|
|
|
Dear Friends,
I have Standard Package in VB6. When I am installing it on any computer I am getting error as below
1)msvcrt.dll can not used or can not registered
2)msado20.dll can not used or can not registered
please help me to solve these errors. Really I felt Nervous when i am installing my package at customer site.
Your help will be highly appriciated.
Thanks
Patel Murtuza
|
|
|
|
|
MSADO20.DLL????? How old is this thing?! Did you build this package and what version of VB did you use?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using visual basic 6 and the package evry time i am making this problem is coming while installing
msvcrt and msado20 both error or some time one of them is getting problem
thanks
Murtuza
|
|
|
|
|
VB6.... It's very vague, but I seem to remember that you could ignore replacing the first file. The second file you should install anyway. Install MDAC and you'll get it. I'd go back through your Setup and Deployment wizard and remove the dependancy for this one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I have a xml file with about 3 levels. I would like to convert this data into a tabular format. i.e., if the xml is of type:
<Company>
<GroupName>Technology
<Student>
<Name>
<FirstName>Bill</FirstName>
<LastName>Gates</LastName>
</Name>
</Student>
</GroupName>
<GroupName>Art
<Student>
<Name>
<FirstName>Da</FirstName>
<LastName>Vinci</LastName>
</Name>
</Student>
</GroupName>
<GroupName>Sports
<Student>
<Name>
<FirstName>Pete</FirstName>
<LastName>Sampras</LastName>
</Name>
</Student>
</GroupName>
</Company>
The output should be of the format:
GroupName FirstName LastName
********* ********* ********
Technology Bill Gates
Art Da Vinci
Sports Pete Sampras
Hope you got my problem. I do not want to use any dataset stuff. Can it be done using plain XML classes. I could get the data in name:value pairs. But from that how do i show them in a tabular format (say, on a label control) ?
Thanks in advance
Prasad P
|
|
|
|
|
Yes, it can be done. But this stinks of homework, so you'll have to at least make an attempt to write the code, first.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
Iam having one assignment that i want to run the command prompt through vb.net and to show the output in richtext box.
if any body knows the coding please help me.
|
|
|
|
|
Here is some code I had around to execute a program in DOS and redirect the output back into my program but I put it into a list box. Should be no big deal to use a RichText box.
Imports System.ComponentModel
Private ERROR_FILE_NOT_FOUND As Integer = 2
Private ERROR_ACCESS_DENIED As Integer = 5
' This code will execute a program on the file system
' and redirects output to this program.
Dim myProcess As Process = New Process
Try
Dim prgOutput As String
Dim strSplit() As String = Nothing
Dim delimStr As String = Chr(13) & Chr(10)
Dim delimiter() As Char = delimStr.ToCharArray()
myProcess.StartInfo.FileName = tbPath.Text
myProcess.StartInfo.Arguments = tbOptions.Text
myProcess.StartInfo.CreateNoWindow = True
' Must be false to be able to redirect DOS program output
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()
myProcess.WaitForExit()
' Get the output from the DOS program
prgOutput = myProcess.StandardOutput.ReadToEnd
prgOutput = prgOutput.Replace(delimiter, "|")
strSplit = prgOutput.Split("|"c)
For i As Integer = 0 To (strSplit.Length - 1)
lbOutput.Items.Add(strSplit(i))
Next
Catch ex As Win32Exception
If ex.NativeErrorCode = ERROR_FILE_NOT_FOUND Then
Console.WriteLine((ex.Message + ". Check the path."))
Else
If ex.NativeErrorCode = ERROR_ACCESS_DENIED Then
Console.WriteLine((ex.Message + ". You do not have permission to _
print this file."))
End If
End If
End Try
|
|
|
|
|
hi
i had used the api to open the registry which is (copied from api text viewer).
RegOpenKeyEx(ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
where the first parameter values given in msdn are
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
when it use anyone of those it gives error that unknown symbol. tell me what to do these are not reserved work bydefault.
ddd
|
|
|
|
|
Hi;
You do not have to use win32 api's to read or write to the registry in Visual Basic. The .Net Framework has a class called RegistryKey which is better to use. Here is some code I wrote to get Windows IIS root directory from the registry.
Dim hive As RegistryKey = Registry.LocalMachine ' This the HKEY_LOCAL_MACHINE
Dim subKey As RegistryKey ' The path to to the subkey
Dim keyValue As String ' the value your looking for
subKey = hive.OpenSubKey("SOFTWARE\Microsoft\INetStp", False)
keyValue = CStr(subKey.GetValue("PathWWWRoot"))
hive.Close()
lblWWWRoot.Text = keyValue
--------------------------------
This link will take you to the documentation for RegistryKey
RegistryKey Members
--------------------------------
Just info, the constants HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HEY_LOCAL_MACHINE, HKEY_USERS are found in the Windows DDK include directory.
|
|
|
|
|
If your using VB.NET, the declaraiton you have won't work and isn't necessary. The .NET Framework has a Registry class that is easier to use than this.
If your using VB6, then go back to the very same APIViewer and use it to show you what the Constants are. There is a drop down box that will allow you to pick what your looking at.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
Can anybody tell me that how to create Active Reports in Crystal report?
and how to develop front end for Active Report in VB.NET?
|
|
|
|
|
hi you all,
i think this is a difficult question:
let's say i have a county and about 20 firefight stations in known places (x, y coords).
i need to keep open and active 5 stations at a time.
so i need to build 4 groups of stations so that, in each group, every station has to "cover" more or less 1/5 of the county territory.
how would you solve this problem?
any help will be greatly appreciated,
thanks in advance!
Fuel2Run
|
|
|
|
|
|
Hi Colin,
yeah you're right
i know GIS would be the most logical solution but i think the people that have to manange those stations have no gis,
i guess the solution should be an application that perform only that specific "GIS like" analysis.
so my question was about the calculation and data structure to do it
thanks!
Fuel2Run
|
|
|
|
|
It is not a trivial solution. I spent 5 years writing GIS software (the core of a GIS system) and a further 2 on the business application end.
You could go for a simple as-the-crow-flies measurements, but that won't take into account things like the road network and so on.
If you can, I'd get a plug in component for your application and put all the data in that and get it to do the hard work.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
you are very kind,
but the app i need is just a favour to a friend of mine, i guess you are thinking of serious "pro" application.
it has got to be as much easier as possible so the as-the-crow-flies measurements might be ok but i need to figure out how to take into account the portion of county covered by each station, to decide wich station belongs to a group instead of another or even if i can or not build up such groups.
i know, it'not trivial at all.
you seem to be quite skilled in geographical information systems, do you think that an "easy way exists" or not?
thank you, cheers!
Fuel2Run
|
|
|
|