|
Few pointers:
- Post your code in the code block tags (click 'code block')
- (Like CG said) use some better descriptive control names, textbox1 has no meaning
- You said it worked a few days ago, what has changed since then? (in code or on your pc)
- Have you debugged this, if yes where is it going wrong
- What is going wrong?
- Any error? (post it and the line that is causing the error)
Without this information or a mind reading machine nobody is going to be of much help to you
|
|
|
|
|
He/she is spamming the whole site. I read them all - it looks like the code is now returning empty strings. I assume this means that the WMP can't find the internet, can't find the CD in the database, or that for some reason, the WMP version is no longer looking up CD data. Obviously, this person has written next to no code, they just found a snippet that gets the info from WMP.
I am having trouble working out how putting all the text in one textbox, constitutes a database.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
its not the connection to the database that is the problem, its the begining thats the problem. right after u insert the cd, it doesnt copy the contents off the cd.
|
|
|
|
|
I'm sorry, but this makes no sense at all. Perhaps if you answered my reply to you ? You're not getting values anymore, so what changed ? Is it the same CD ? Is your computer online ? Did your windows media player version change ? If you put the CD in to the computer and run windows media player, does it show the right tracklist ?
Do you have a database at all ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
And yet, when people try to help you, you just don't reply, or don't really answer our questions.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Have you checked to make sure you are inserting the CD upside down? When copying a CD via C# code written in VB, you must reverse the polarity of the pre-recorded bits. The standard method for turning bits into stib is simply to turn the CD over.
|
|
|
|
|
there is no error. its just not retrieving the details off the cd. I'm sorry if it seems am flooding the site. but am just tryna get help.
|
|
|
|
|
mimi8469 wrote: I'm sorry if it seems am flooding the site. but am just tryna get help.
Perhaps if you read and responded to the help you've been getting, instead of just reposting the same thing, you'd have it fixed.
Are you waiting for Windows Media Player to get a chance to read the CD contents ? Perhaps the control has an event it fires when it's read a CD and found it's contents ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
mimi8469 wrote: but am just tryna get help.
Oh, well, that justifies everything. Maybe you should send emails direct to Chris Maunder. Why waste time on us, when you can go to the top?
|
|
|
|
|
I take this to mean you're not going to respond to our attempts at helping. When will you be failing this course ? Do you intend to post the same question over and over until you do ? I am assuming you don't want to pass, or you'd want our help.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I am assuming you don't want to pass, or you'd want our help.
Why should he trust you? You didn't even tell him about reversing the polarity of the CD by flipping it over.
|
|
|
|
|
ROTFL - see, I was saving that bit of knowledge for myself.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I was saving that bit of knowledge for myself.
You're just too damn selfish, Christian. These noobs need to be coddled and pampered, after all they will be writing the software of tomorrow. Well, actually we'll be writing it but they'll be cutting and pasting our code which is the same thing in India.
|
|
|
|
|
mimi8469 wrote: PLS I NEED HELP.. AM DESPERATE..
No, you're not. You're not even interested. I tried all day to get you to answer me so I could help you, and you couldn't be bothered. I assume as your deadline gets closer, you'll post again, but if you care enough to post, I can only assume you can't understand what we're telling you, so your best bet is to approach the teacher to discuss if you're smart enough for a programming course.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I wonder how s/he accepts such projects without knowing a thing about what s/he is actually trying to do. What is more funnier is that s/he is worried about reaching deadlines too.
|
|
|
|
|
Hi
I'm trying to read a selected pixel color of another application but having some difficulties. Here's the code:
<br />
Public Sub GetNewPicture(ByVal hwnd As IntPtr, ByVal WindowWidth As Integer, ByVal WindowHeight As Integer)<br />
<br />
Dim b As Bitmap<br />
Dim gfx As Graphics = Graphics.FromHwnd(hwnd)<br />
<br />
b = New Bitmap(WindowWidth, WindowHeight, gfx)<br />
<br />
MsgBox(b.GetPixel(5, 5).R)<br />
<br />
End Sub<br />
The b.getpixel(5,5).R always return 0. I use this approach because I don't want too use the standard GetPixel Api because it's way too slow. But I can't get this to work. Help is really apprechiated.
EDIT: Forgot to tell you that I want to read the pixel color of the program even if it's not the top-most window (Hidden by another window). Would this ever be possible or is it impossible?
|
|
|
|
|
Member 4368316 wrote: I use this approach because I don't want too use the standard GetPixel Api because it's way too slow
Well, this is dumb. You're STILL calling GetPixel, you're just creating an entire bitmap first. You think that will be faster ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yeah you'r correct, but I won't use the code I wrote before like that. I'm going to take the "sceenshot" of the application and then from a separat function get the pixels (at least that's the idea). It's alot faster (in my Opinion) if you need to read many pixels. Here's another code I used before to get pixels (which is faster than calling the GetPixel Api directly). But it's limited to only the visible windows. I want to get the pixels even if the window is invisible (behind another window and not necessary minimized).
<br />
Private b as bitmap<br />
<br />
Public Sub Screenshot()<br />
<br />
b = New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height,Imaging.PixelFormat.Format32bppArgb)<br />
<br />
Dim gfx As Graphics = Graphics.FromImage(b)<br />
<br />
gfx.CopyFromScreen(My.Computer.Screen.Bounds.X, My.Computer.Screen.Bounds.Y, 0, 0,Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)<br />
<br />
End sub<br />
<br />
public function GetPixel(byval x as integer, byval y as integer)<br />
<br />
return b.GetPixel(x, y).R<br />
<br />
End Sub<br />
modified on Tuesday, November 10, 2009 3:41 PM
|
|
|
|
|
Member 4368316 wrote: It's alot faster (in my Opinion) if you need to read many pixels
Calling GetPixel, is faster than calling GetPixel ? Really ?
You should read my image processing articles to find out how to actually look pixels up quickly.
Member 4368316 wrote: But it's limited to only the visible windows. I want to get the pixels even if the window is invisible (behind another window and not necessary minimized).
The pixels don't exist, how can you get them ? If you have a handle to the window, and it's a .NET object, you can call DrawToBitmap, otherwise, you can't read a pixel that does not exist.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sorry for the confusion I didn't mean the call to GetPixel is faster, I meant it's faster to use the GetPixel if you have the source in memory and getting all the pixel directly from memory (When I think about it shouldn't all pixel information be in memory?). Well I'm starting to get confused, I try to find your article Christian Graus maybe things will clear up for me . Am I wrong when I think I see a speed improvement with the code in my second post. If you would compare it with the createDC("DISPLAY",0,0,0) combined with the GetPixel way?
Christian Graus wrote: The pixels don't exist, how can you get them ? If you have a handle to the window, and it's a .NET object, you can call DrawToBitmap, otherwise, you can't read a pixel that does not exist.
Okey that's bad news I just thought it was possible because I think I remember a while ago I saw an article about hooking a program that was minimized to get it's pixels. And by that I thought the pixel information must be stored somewhere even when the window isn't visible.
Edit: I have read some of your article Christian Graus (Image Processing for Dummies with C# and GDI+ Part 1 - Per Pixel Filters[^]) is your way (LockBits) the fastest or is BitBlit faster?
Edit2: I think I have found a article that has the solution I'm looking for. http://www.fengyuan.com/article/wmprint.html
modified on Tuesday, November 10, 2009 5:33 PM
|
|
|
|
|
Member 4368316 wrote: is your way (LockBits) the fastest or is BitBlit faster?
They do different things. LockBits locks the bits to view them. BitBlt is how C++ draws an image. In C++, if an image is a DIBSection, you get a pointer and can access the data, just like you can with LockBits, so I assume a GDI+ bitmap is always a DIBSection. This makes it possible that GetPixel is faster in C# than in C++, but you at a minimum still pay the cost of a method call.
I don't believe you can use pointers in VB, you may need to write this part in a C# dll to use my code.
Feng Yuan is a very cool guy, his book on C++ Graphics programming is the best one I've ever bought. The code you're linking to is in C++, you realise that, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: Feng Yuan is a very cool guy, his book on C++ Graphics programming is the best one I've ever bought. The code you're linking to is in C++, you realise that, right ?
Hehe yea I know, I just linked to show that there is a workaround (for future readers). The only question now is if there's any possibility to implement that into vb or if I should modify his program instead. I haven't read the article yet so I will start off with that first
Thanks for your help Christian Graus.
|
|
|
|
|
You should be able to use p/invoke to call C APIs in VB.
Good luck.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: Feng Yuan is a very cool guy, his book on C++ Graphics programming is the best one I've ever bought.
Sorry to nag you Christian, but would you have a link to where I can purchase it, I'm in the market for a good c++ book (ship to canada = gold), and again only if you have a url handy..
|
|
|
|
|
suppose in a string var ="abc" values i want that Keyboard automatically type this string in TextBox
plz tell me how its possible
|
|
|
|