|
It's solved now.
I found another sample code for the context creation which worked fine. I don't know what the problem was... nevermind.
Thanks anyway Orthun!
/PA
|
|
|
|
|
Hi,
some questions regarding GDI+ and general who to write code that demands high throughput.
1) I load an image with the image constructor of gdi. This takes about 20ms for an 720*565 RGB tiff image (1.6mb). This sounds eventually reseonable to me since random access of hdd should be about 8ms - 12ms. Question: could it be faster? Is 20ms to long? (I think about processing 30images per second and I want to do image processing. consequently i've just 10ms left for that. ) How can I process this huge amount of data faster (1.6mb*30 = 48mb/sec)? Since i load single images i dont know if its somehow possible to have a stream of data ... any comments?
2) I need to access the bitmap data of the image. Therefore i use the the LockBits method to receive the BitmapData. What I found very strange is that this method needs huge amount of time (20 - 100ms). This sounds very unreasonable to me since the data should already be in memory and all i want is a nice pointer to the data. The code I use is:
m_pBmSource->LockBits(&Rect(0,0,m_pBmSource->GetWidth(),m_pBmSource->GetHeight()),ImageLockModeRead | ImageLockModeWrite,PixelFormat24bppRGB,&m_pBmDataSource);
where m_pBmSource is the pointer to a Bitmap.
if you need more information to be able to help please let me know.
Many thanks
micheal
|
|
|
|
|
I can center text horizontally in a CEdit control,
but I can't figure out how to center text vertically
in a CEdit control. Any ideas?
Please, any response any one can give me will be
greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
DanYELL wrote:
Any ideas?
Add the ES_MULTILINE and ES_CENTER styles to the edit control. Now try the following:
m_edit.SetWindowText("H\r\ne\r\nl\r\nl\r\no\r\nW\r\no\r\nr\r\nl\r\nd\r\n!");
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does anyone know how to get the position of the mouse with regard to the sceen instead of the application? For example if the window was located in the middle of the window and the cursor was over the upper left corner i would like to get something like (250, 250) instead of (0,0). Any ideas?
|
|
|
|
|
|
Awesome, thanks a bunch....
|
|
|
|
|
GetCursorPos() always returns the mouse position in screen coordinates.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Anybody knows how can i have a dialog always visible on screen, fixed even when other applications are the active ones?
|
|
|
|
|
One possible solution is topmost style.
Kuphryn
|
|
|
|
|
Is it possible to lift a dialog from one application and copy it into another (diaDlg.cpp and diaDlg.h). Its for a MFC Dialog based application, the dialogs are Modeless ones.
My new applications wishes to make use of one or two dialogs (out off about 8).
I would want the new application have complete control of the inserted dialogs.
For the resources, do you have to go into the resource.h file and lift them out, and renumber? Sounds bad if you do.
Or is it best to start from scratch again.
Regards,
Sweep
|
|
|
|
|
Try exporting the resource and then simply import the resource and .h and .cpp files into the new project.
Kuphryn
|
|
|
|
|
Thanks, but could you provide a bit more information.
If I select the dialog I wish to use in another program, the Export option is greyed out in the 'Resource View'
Also how do you import the Resources.
Sorry but at my limit of the IDE.
|
|
|
|
|
You mean that you didn't have source code available of application where the source dialogs are?
In any case, always it's possible to edit resources and copy and paste the dialogs you want in other application.
Jaime
|
|
|
|
|
:(Both programs are on my hard drive.
Its just I always worried about screwing up the IDE by
cutting/paste between applications.
But I would like to reuse a couple of modeless dialogs in another program.
Its just how to 'export' the resources from one into the other. I know
I can copy over the abcDlg.cpp and abcDlg.h files.
Any info would be useful.
Graham
grahamfff
|
|
|
|
|
Just open the EXE with VC++ resource editor.. copy and paste the dialog into your application.
You may need, however, to add manually IDC_ #defines to the controls.
Jaime
|
|
|
|
|
The safest way to copy resources from one project to another is by editing the .RC file and the resource.h file in the text editor. You can copy/paste the .RC text from one file to another, and do the same with the identifiers used by the dialog in the resource.h. You may need to renumber the identifiers after you paste them into the new resource.h.
Software Zen: delete this;
|
|
|
|
|
OK thanks your suggestion seems the best to date.
|
|
|
|
|
hi,
what can I use FileChannel(valid in JAVA) in C++.
|
|
|
|
|
Hi there,
Can anyone tell me how can I track other application window handle and automate/simulate the object evens on that application window like button press etc..
Application will be running on the same PC, just like an .exe application.
Regards
|
|
|
|
|
Use SendMessage() or PostMessage() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
1- use the spy to get the caption of the target window
2- use FindWindow to get the handle to this parent window
3- use EnumChildWindow(given the parent window handle) to loop onto the child windows of that parent window(like button,label,..etc
4- use SendMessage to fire the action of any child window.
any function i listed,see its def. from the MSDN,and its details..
by the way..i had automated so many other applications windows..
bye..
Amr
Hawk,amr
|
|
|
|
|
I've added an accelerator, then Ctrl+W then selected my main Dlg class.
However, when I run my program and press the keys, the accelerator doesn't work...
thanks for help
-Mike
|
|
|
|
|
Have you called LoadAccelerators() in the dialog's constructor? You'll also need to override the PreTranslateMessage() method and call TranslateAccelerator() accordingly.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hmm, can you give me an example please?
I'm kinda new...
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CD2HackKitDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
thanks
|
|
|
|