|
The only thing that I would add to Dave Ks' answer (below)
is that you cannot get the pixel from the picturebox, you have to get it from the PictureBox.Image property and cast it to a Bitmap.
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
yes I agree you dear that picturebox does not have getpixel property well that problem has solved now I have trouble to perform this code in vb.net
Private Sub UnRGB(ByVal color As System.Drawing.Color, ByRef r As Byte, ByRef g As Byte, ByRef b As Byte)
r = color And &HFF
g = (color And &HFF00) \ &H100
b = (color And &HFF0000) \ &H10000
End Sub
|
|
|
|
|
You don't need it! Once you have the Color from GetPixel, you already have everything this code does! Check the R, G, and B properties of the Color you got back.
|
|
|
|
|
It's easily done using the methods already built in to the Bitmap class. You don't even need this function. Your're calling this with the color of a pixel already, so you already have the R, G, and B properties of the color.
Dim pixelColor As Color = MyBitmap.GetPixel(x, y)
Dim R As Byte = pixelColor.R
Dim G As Byte = pixelColor.G
Dim B As Byte = pixelColor.B
|
|
|
|
|
but dear what about this code...
Private Sub UnRGB(ByVal color As OLE_COLOR, ByRef r As Byte, ByRef g As Byte, ByRef b As Byte)
r = color And &HFF&
g = (color And &HFF00&) \ &H100&
b = (color And &HFF0000) \ &H10000
End Sub
how i Perform Loggical And operation....
|
|
|
|
|
sarfarazaliqureshi wrote: but dear what about this code...
You have misunderstood.
Dim R As Byte = pixelColor.R
Dim G As Byte = pixelColor.G
Dim B As Byte = pixelColor.B
Is that code
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
Actually it is part of Steganography project and I need to Perform This And operation so that I can Store data at Random ...
r = color And &HFF
g = (color And &HFF00) \ &H100
b = (color And &HFF0000) \ &H10000
|
|
|
|
|
In your VB6 code, all that the UnRGB function did was to extract the red, green and blue values from a color.
and put them into clrr, clrg and clrb
UnRGB picImage.Point(r, c), clrr, clrg, clrb
Private Sub UnRGB(ByVal color As OLE_COLOR, ByRef r As Byte, ByRef g As Byte, ByRef b As Byte)
r = color And &HFF&
g = (color And &HFF00&) \ &H100&
b = (color And &HFF0000) \ &H10000
End Sub
Daves code
Dim R As Byte = pixelColor.R
Dim G As Byte = pixelColor.G
Dim B As Byte = pixelColor.B
does that except he has called clrr R, clrg is now G, and clrb is B.
I explained how to get the pixel in a reply to your earlier post.
You now have enough information to solve your problem.
Do not expect us to write it for you.
Do you realise how complex steganography is? If you are unable to grasp the connection between the answers you have been given here and your VB6 code, then you will not be able to cope with steganography.
You might get a better understanding if you go to the Home page of CP and use the search box to look for steganography. There are loads of articles there. I havn't looked at them all but I would expect there to be some in VB.Net
Good luck!
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
Thanks Friend Your Information is Usefull for me and I know Steganography but u r right not enough thx
|
|
|
|
|
I’m new to VB and WPF and struggling with a SQL query that contains a JOIN. This almost works by there is something not right with the JOIN or SELECT statements. If someone can point me to a resource that contains the proper syntax for statements like the one below, I would be very appreciative. Oh...and I'm using VS2008.
Class Window1
Private db As New cmaDataContext
Private UserView As BindingListCollectionView
Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim CMAusers = From a In db.tsmContacts _
Join b In db.tsdContactDetails On _
a.intSystemUserID Equals b.intSystemUserID _
Where a.bitDeleted = "0" _
Select a.vchFirstName, a.vchLastName, a.vchMiddle, b.vchEmail
Me.DataContext = CMAusers
Me.UserView = CType(CollectionViewSource.GetDefaultView(Me.DataContext), _
BindingListCollectionView)
End Sub
Thanks,
Todd
modified on Tuesday, January 13, 2009 12:15 PM
|
|
|
|
|
|
Thanks Mika. That should do it.
TD
|
|
|
|
|
No problem. Just a minor correction. It isn't actually SQL you're using but LINQ[^]. Although the syntax is somewhat similar, the concept is very different.
|
|
|
|
|
I was given a service application that manages (creating/deleting) the partitions on database tables. Currently at the top of every hour, the progam adds a new partition & deletes any partitions that are older than 36 hours. I am being asked to modify this so that on startup the application creates 36 paritions for each of the tables. Then at the top of every hour, it will create a new parition for time + 36hrs and again delete anything older than time-36hrs. A timer is used (with a 30 second interval) to check if it is the top of the hour.
I have 2 questions.....
1. I created a flag and set it to true on startup. Timer tick sub routine checks the flag, if it is True, the app loops through each table and creates 36 paritions, then sets the flag to False. Every time there after, the timer tick routine checks the minute property of the current time and if it is 0, runs the routine to create the new partition and delete the old. Is this the most efficient way to do it. I was reading about custom actions for setup projects and was thinking that maybe the first 36 could be created using this.
2. The timer tick every 30 seconds to check the minute property but I was wondering if there was a better way to check for the top of the hour.
Thanks in advance
|
|
|
|
|
I would guess that your timing system is efficient enough considering the task you'r doing. Creating and deleting partitions isn't a small job for the database engine.
Just a question: You didn't say what database you're using, but if it is SQL Server, why wouldn't you create a job under SQL Agent. You could do the programming using T-SQL thus eliminatig roundtrips to database. Also the database wouldn't depend on any service outside the SQL Server itself. For example if your service is stopped, halted etc, your database wouldn't act as expected. Also I believe that both the performance and maintainability would increase.
|
|
|
|
|
thanks for your response.
To answer your question, I am using Oracle 10g enterprise. Is there something in Oracle like the SQL Agent you were talking of. I do not have much experience using db, i was just handed this so I am kinda shooting from the hip.
Thanks again
|
|
|
|
|
captainmogo wrote: Is there something in Oracle like the SQL Agent you were talking of.
Yes, actually there are a few methods you can use, but I think that the most suitable could be that you use DBMS_SCHEDULER package. It can schedule a job with a given interval. You can find it in documentation in book named "PL/SQL Packages and Types Reference".
But before going into details, have a look at this article: Schedule Away the Routine[^]. I think it describes well the basic concepts of the scheduler.
Hope it helps,
Mika
|
|
|
|
|
I am trying to change a name of a worksheet.
Currently using ...
Sheets("RDC.d").Select<br />
Sheets("RDC.d").Name = "RDC"
However, the sheet RDC.d is produced from a secondry source and the name changes each time it is requested.
(The RDC part is consistant, the .d may be .g, .h etc)
How do I generically change the worksheet to RDC?
I may point out that the only sheets active will be the Mastersheet I am working in and this report sheet RDC.x
I have tried activating the report sheet...
Sheets(1).Select<br />
Sheets(1).Name = "RDC"<br />
<br />
But this is not working.
Any suggestions?
------------------------------------
"The greatest tragedy in mankind's entire history may be the hijacking of morality by religion"
Arthur C Clarke
|
|
|
|
|
OK Don't Bother
I just sussed that I was right and wasn't asking it to do what I wanted it to do!
Memo to self...READ WHAT YOU TYPE!
------------------------------------
"The greatest tragedy in mankind's entire history may be the hijacking of morality by religion"
Arthur C Clarke
|
|
|
|
|
Hi experts,
Here is an another problem of mine.
I have created a process using
dim p as new process
p.startinfo.filename="calc" 'or notepad
p.start()
Now,my problem is when I run the process the second time, it opens a new exe. That problem can be solved by raising an event. But, I want to MAXIMIZE the exe on top of all window ,if an instance is already running.(we can see the running process in taskbar, but my taskbar is also disabled for some reason, so i want it to get it top of my application with the help of code)
Since my main window doesn't have any close/minimize/maximize button, I want to show the user already running process by bringing the exe on top of my main form.
Could anyone give a solution please.
Thank you in advance.
|
|
|
|
|
Why would you want to prevent 2 calculators from being opened? Or two of anything? At any given time I have a good 7 or 8 notepad's open.
|
|
|
|
|
Member 4250705 wrote: Hi experts,
I'm not sure anyone here would want to lay claim to being an 'expert'.
ex - signifies a has been
spert - well a spurt is a drip under pressure.
You might want to try "Hi oh exalted gurus."
Much better.
Henry Minute
If you open a can of worms, any viable solution *MUST* involve a larger can.
|
|
|
|
|
Member 4250705 wrote: Hi experts,
I prefer, "Your Eminence" myself, but, whatever...
Member 4250705 wrote: Now,my problem is when I run the process the second time, it opens a new exe
OK, so keep the process in a class global variable and check to see if it's Nothing and check to see if it's HasExited property is True before you try to launch another copy.
Also, to maximize the window of another process, you have to send the MESSAGE to the app's window. You can get the window handle to send the message to from the Process class's MainWindowHandle property. Then you just have to call the Win32 API function SendMessage with the window handle and the message. You can get a code example on SendMessage from PInvoke.net[^].
The two constants for the WM_SYSCOMMAND and SM_MAXIMIZE message are:
Private Const WM_SYSCOMMAND As Integer = 274
Private Const SC_MAXIMIZE = 61488
Private myProcess As Process = Nothing
...
If myProcess Is Nothing OrElse myProcess.HasExited Then
myProcess = New Process()
myProcess.StartInfo.Filename = "calc"
myProcess.Start
Else
''' This is where you would send the message to the main window
''' to maximize the window.
End If
You'll have to do some more work to account for the case of the Process exiting, but this should be enough to get you started.
|
|
|
|
|
Thanks a lot for your advice
|
|
|
|
|
thanks a lot...
Could u please tell me how to send a message to maximize to the main window...
Else
''' This is where you would send the message to the main window
''' to maximize the window.
Thanks
I am a learner Always
|
|
|
|