Re: WM_PAINT question...
From: Stoitcho Goutsev \(100\) [C# MVP] (100_at_100.com)
Date: 06/15/04
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: Using DataSet in the memory cache???"
- Previous message: Andrew Baker: "Re: Help with Regex and trying to mimic the VB "like" comparison"
- In reply to: Kevin Dombroski: "Re: WM_PAINT question..."
- Next in thread: Roy Fine: "Re: WM_PAINT question..."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Jun 2004 10:58:42 -0400
Hi Kevin,
Yes, ToString exists for bitmap objects as it exisits for all objects
because it is defined in the Object class. You can call it and you will get
a string which contains the name of the class. Something like
"System.Drawing.Bitmap". Thing of it. As the name suggests it is only an
area of pixels, which has some color. There are not strings, rectangles,
lines or whatsoever. There are only pixels. That's why if you want to
extract the text from a picture you have to use some algorithm for image
recognition (OCR). Such algorithms are fairly complex and are definitely
not somethig, which can be implemented "first thing in the morning". With
meta files (as the others suggested) is kind of different. The metafiles are
list of gdi (or gdi+) commands which are executed (played) over some device
context. As such they can be enumerated and all the commands inside can be
regognized and parsed. So with some degree probability TextOut commands can
be catched and the arguments (the text) could be extracted. Again there are
some problems of letting the controls to paint into an arbitrary device
context. It can be done via WM_PRINT and WM_PRINTCLIENT if implemented by
the target control, which usually is not for controls different than the one
provided by micorosoft.
-- HTH Stoitcho Goutsev (100) [C# MVP] "Kevin Dombroski" <kdombroski@comcast.net> wrote in message news:jjBzc.57680$Sw.1000@attbi_s51... > Thanks for the reply... How about this off the wall theory: since the text > is being painted, can I obtain a bitmap of the client area (it's small, if > that helps my cause). I'm sure that's doable - now all I need is a > "ToString()" method for the bitmap object??? I'm sure I'm really reaching. > Not sure if this method exists for a Bitmap object!?!?! > > "John Wood" <spam@isannoying.com> wrote in message > news:u5TxNOnUEHA.3540@TK2MSFTNGP11.phx.gbl... > > Not easily. > > You might be able to forge a WM_PAINT and send that to the applicaiton, > > providing a device context that you have initiated the recording of > metadata > > on, but that's only a theory and probably won't work in practice because > of > > calls to BeginPaint etc. > > > > Other than using OCR I think you might be out of luck. > > > > If you just want to do it occasionally, you could just get the application > > to print the stuff, and have it print to a postscript printer (print to > > file), then you could probably pull the data out of the file. > > > > Hope that helps a little. > > John > > > > "Kevin Dombroski" <kevin.dombroski@comcast.net> wrote in message > > news:tHqzc.31914$2i5.16821@attbi_s52... > > > > > > Howdy - I would like my application to be able to read data from another > > > application. Specifically, I would like my to get the text from the > > "client > > > area" of another application's window whenever it's processing a > WM_PAINT > > > message? Can I do that? I've been searching around MSDN and Google, but > > I'm > > > not really finding a way to do this. Please let me know if you have an > > > idea - thanks! > > > > > > > > > > > >
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: Using DataSet in the memory cache???"
- Previous message: Andrew Baker: "Re: Help with Regex and trying to mimic the VB "like" comparison"
- In reply to: Kevin Dombroski: "Re: WM_PAINT question..."
- Next in thread: Roy Fine: "Re: WM_PAINT question..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|