|
What the <blank> are you talking about. The mouse cursor belong to no application, unless it has captured it. It belongs to the system. Therefore it does not have or require an ID.
INTP
Every thing is relative...
|
|
|
|
|
Hi,
I am coding for a project in which it is required that I draw circles of certain radius over a scanned map (saved as a bitmap) and then save the changed map.
I know how to display a bitmap. I also know how to make an independent drawing and save it as a bitmap. But how do I do both – open an existing bitmap, draw over it and then save it? Please give me some idea.
Thanks,
Tara
'Fortitudine Vincinues'
|
|
|
|
|
Hi
There are many ways to do. I am just giving one of the way. Don't know how efficient it is. Since a long back I left programming of bitmap.
any way lets try.
1. Create a CBitmap member;
2. Draw to DC as you are doing the image and the circle.
3. Explore the DrawState funtion of CDC class. i.e use this funtion to link between your DC and CBitmap.
4. Then convert the CBitmap to DIB.( you will get lots of article on net / CP )
5. Once you get hte DIB you won't have any problem to save it.
Regards
Anil
|
|
|
|
|
If you know how to do "...an independet drawing and save it as a bitmap". Then you already know the answer to your quesion.
Which bitmap are you saving? The one before you drew on it or the one after you drew on it.
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: Which bitmap are you saving? The one before you drew on it or the one after you drew on it.
Well, actually I learnt how to make a drawing on to a dialog box and then save the drawing as a bitmap from CodeProject. So I know how to save a drawing as bitmap.
What I want to do is:
1) Display a bitmap when the user opens it(ie. the user opens the bitmap eg. map of an industry)
2) Ask the user to click the mouse on a certain point on the bitmap
3) using that point(x and y coordinates), I do some calculations and get the correct radius.
4) Then I display to the user a circle of the calculated radius around that point on the map.
5) If the user selects 'save', I must save the whole thing i.e. the map with the circle on it, as a single bitmap.
I hope I am stating my problem clearly...
I tried creating a dc to hold the bitmap which the user opens and using the same dc, i tried to draw a circle on the bitmap... but it dosent work.
Your help will be highly appreciated. Thank you.
Tara
|
|
|
|
|
Try studing the
Memory bitmap class CMemBm[^]
The basic steps are:
1. Create a compatible DC. Lets call it memDC.
2. oldBitmap = Select your bitmap into memDC.
3. Draw on memDC.
4. Select oldBitmap into memDC.
The bitmap should now have whatever you drew on it. To test that it does, blit it to your client area.
If you drew on a bitmap, say using the mounse, in the client area. Then you need to get a copy of the bitmap from the client area. In order to do that you must know the client coordinates where the bitmap is located.
1. Create a compatible DC. Lets call it memDC.
2. Create a compatible bitmap, that is the same size as the area that you want to copy. Lets call it tempBitmap.
3. oldBitmap = Select your tempBitmap into memDC.
4. Bit blit the rectangular area from the client DC to the memDC.
5. Select oldBitmap into memDC.
6. Finish cleaning up.
Now tempBitmap should contain a copy that matches the area of the client you specified. To test it, just clear an area of the client and blit the tempBitamp there.
I hope that helps.
INTP
Every thing is relative...
|
|
|
|
|
Thanks John.
I am going to try it. Hope it takes me only few days and not weeks to finially get it. Bitmaps, somehow seem to be beyond my understanding...
Thanks again.
Thank you, Anil too for your suggestion.
Tara
Will get back soon..hopefully with an not with
|
|
|
|
|
Hello,
i need help for my final project...it is about generating thumbnails from images(pgm format) by half or by 2 or if possible generating thumbnails of size 75*75 pixels....if someone can give me code(in C++) or algorithm to scale images up and down....thx u in advance.
Amrita
|
|
|
|
|
|
Hi,
i program a app which surport output a word doc from displayed contents. But now i got another problem, i cannot set the pragraph format (exp. paragraoh indent and so on) by my app automatically. I found a method -- void Selection::SetParagraphFormat(LPDISPATCH newValue), but i cannot manipulate it correctly. Please tell me how can i get rid of it.
Thank you ~o~
|
|
|
|
|
Oh, i got it as following...
//----
_ParagraphFormat wordFormat;
wordFormat = sel[i].GetParagraphFormat();
wordFormat.SetCharacterUnitFirstLineIndent(-5);
|
|
|
|
|
Hi!
I am a new member to code project and this is my first message to the forum. I am a 6th sem MCA student doing my project work in a company as part of my academic curriculum.Presently i am working on a software related to GUI testing. I am using some MFC application exe files for this purpose. My problem is that some of the exe files i am using end up with errors at the runtime. So it is my request to every member of this forum to please suggest me as to how i can get the source code of an MFC application after it is converted to exe format.
Pavithra
|
|
|
|
|
Pavithra Bhat H wrote: How to get the source code of an MFC application with .exe file extension
Try to open the file in notepad
if that doesn't work try to get in touch with the original coder and take him out to lunch
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
mailMonty wrote: Try to open the file in notepad
LMFAO
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Pavithra Bhat H wrote: how i can get the source code
Have you tried contacting the original developer of the application and asking them *very* nicely - you never know they might be feeling generous and let you have it...
There is no pratical way of decompiling an exe built with c++ (something which I'm thankful of as it would probobly put me and many others out of business.) The closest your going to get is an assembly dump of the code - something which I'm guessing isn't what your looking for.
If you've got a problem with the application, contact whoever wrote it.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Gavin Taylor wrote: The closest your going to get is an assembly dump of the code
actually, he could decompile an exe into C/C++ code if the exe were built in debug mode...
but i doubt the guy who's asking the question wants to decompile such a thing but a release exe.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
toxcct wrote: he could decompile an exe into C/C++ code if the exe were built in debug mode
Even in Debug mode I didn't think it was possible to decompile it into anything particulary useable, but hey I could be wrong...
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Gavin Taylor wrote: Even in Debug mode I didn't think it was possible to decompile it into anything particulary useable, but hey I could be wrong...
yes, you are.
actually, when an exe is built in debug mode, the compiler don't optimize the code generated, and lets full of stull such as identifier names, etc...
a good decompiler could decompile such an exe into a pretty well way.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
toxcct wrote: a good decompiler
could you name some of them?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
vamshin wrote: could you name some of them
i don't use any of them, because this is simply illegal, and i don't perform such things...
but AFAIR, borland C++ had one...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
Yeah, I know what Debug mode is.;)
Now I think about it I suppose it could be possible to generate a reasonably readable version of your code - Oddly enough, I've never had the need to try decompiling anything i've written.
Hmmm, time to have a google and a play me thinks
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
|
I am working on a software named GUITAR which is available in the site http://guitar.cs.umd.edu
Pavithra
|
|
|
|
|
|
HI Mr Bhatt,
It almost impossible to get Source code of Exe.... as all source code are converted into machine instruction before becoming exe...
now AFAIK only way to debug these type of application using Machine/Assembly Code!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|