|
How do Isave to bitmap the DC bits?
I want to save to file the bitmap loaded to DC + the lines and text I drawed on it (on the DC).
thanks
|
|
|
|
|
Use CDC::SaveDC() for saving the context use CDC::RestoreDC() for restoring it.
Cheers!!
Siddharth
|
|
|
|
|
Thanks, but the point is I want to save it (a part of it where a bitmap was displayed and written on) as a bitmap!!
|
|
|
|
|
hi,
i am drawing a image on dialog. i tried 2 methods but seems not work.
i do sth like this at OnPaint()
void CRlscoreDlg::OnPaint()
{
if (IsIconic())
{
}
else
{
// method 1
CPaintDC pdc(this);
Graphics graphics(pdc);
int showWidth = 240;
int showHeight = 180;
Bitmap b(L"c:\\335\\image.bmp");
Image *img = b.GetThumbnailImage(showWidth,showHeight, NULL,NULL);
graphics.DrawImage(img,10,10,showWidth,showHeight);
/*
// method 2
HWND hwndStill = NULL;
// IDC_STILL is the picture box
this->GetDlgItem( IDC_STILL, &hwndStill );
RECT rc;
::GetWindowRect( hwndStill, &rc );
long lStillWidth = rc.right - rc.left;
long lStillHeight = rc.bottom - rc.top;
HDC hdcStill = ::GetDC( hwndStill );
Graphics g(hdcStill);
g.DrawImage(bb,0,0,b.GetWidth(),b.GetHeight());
*/
CDialog::OnPaint();
}
}
in method 1, the image cant be shown on startup sometimes. but, after minimize and restore it, the image appear!
in method 2, the image just cant display!
any help? ah! i am using gdi+ but i dont think it the problem.
thanks,
jim
|
|
|
|
|
In a MFC,Dialog_Based project ,I want to Know how can I get the position
(coordinate) which the user clicked on the dialog.
I don't Knw how the associated functions .I've seen the Msdn library but
There were not any example. please guide me .
THANK
|
|
|
|
|
|
CPoint cpPoint;
GetCursorPos(&cpPoint);
(SDK version)
|
|
|
|
|
Hi all. I already written a MFC application and I also got the code for a demo on the usage of cximage. Since this demo code is very long and complicated, I do not know how to use it in my currently avaliable application. Can someone advise me on how to do it. Thank you for any advise.
|
|
|
|
|
Hi to you all !!!
When i'm trying to use socket i get very often the following assertion:
"Assertion Failed on Line 851 - Sockcore.cpp"
When entering to debug the line that comes out is:
"ASSERT(pState->m_hSocketWindow!=NULL)"
Some overview of my project:
1) it has two main programs : a server that is written in VC++ 6
and a client that is written in C#.
1) The server doesn't use a static MFC library.
2) The server has some threads that uses a global tcp/ip classes,
These Tcp/IP classes ( instanses of CSocket ) protect the Send
method with a CriticalSection object, so only one thread can send somthing
to the connected clients.
These assertion can be produced repeatedly when the server is running and
the client application ( after being connected and recieving messages from the server correctly ) is debuging in a step-by-step mode.
This assertion also accours sometime while the client is running and is not in debuging mode.
I hope that some of you guys will be able to help me.
Thank you very much.
Conarius.
|
|
|
|
|
what do u mean by very often?
did u call AfxSocketInit at the program's startup routine?
...
Don't try it, just do it!
|
|
|
|
|
Yes , i have.
And "very often" is after 1 or 2 minutes of debug mode.
|
|
|
|
|
Hi every body,
I want the event(notification) of new window creation, so that I can get the handle to that window, and do whatever things I want to do with it.
I am able to get this event using sytem-wide CBT hook. But because of this sytem-wide hook I am unable to get access to functions of components which are part of OLEACC.DLL because of shareability problem.
So I want to get this event(CreateWindow) by some other way(other than global hook). If there is some work around please help.
Avya.
|
|
|
|
|
does anyone know how do i attach exe and other files to a code so when i run the the compiled program it will install the files
|
|
|
|
|
|
Very good point of view Michael
|
|
|
|
|
you do really sound like a bad hacker...
but let's assume u'll use this for an installer:
you could add files as resources(if they aren't very big), then use your software to extract them.
Don't try it, just do it!
|
|
|
|
|
Relax guys. im not going to write a virus and im certinly not a hacker
all im trying to do is a basic multi installations file that will run several installations file depending on the conditions of the system and the server which runs the installations without any user interference. this could have been solved in simple bash script if it was unix.
but since i need it running on windows clients i would have to use a c solution.
*.Think again.... and again and again and again and again
|
|
|
|
|
Hello,
Does anyone have any pointers to articles about making a multi-line list control? I've searched here and cannot seem to find this specific issue.
thanks! JennyP
|
|
|
|
|
I've written one, but that was for work, so I can't post code.
As I recall, I handled WM_MEASUREITEM to reflect the number of lines I wanted, then handled either NM_CUSTOMDRAW or WM_PAINT to paint the text (I can't recall). This was on Windows CE, so you might need to do things differently. This technique only works if all items are the same height, though - that is, they have the same number of lines.
|
|
|
|
|
What is the best way to open a image file and get
access to the raw bytes of the image so that I can
apply various algorithms from Intel's IPP library.
Also what about allocating the wright ammout of memory?
Can I just use GetFileSize or the like to get the required
size of the buffer?
Thank You
Bo Hunter
|
|
|
|
|
depends on what kind of image you want to load...
loading a BMP file is really easy, you have to read the header, allocate memory for the bitmap and read the rest of the file.
Don't try it, just do it!
|
|
|
|
|
I want to write an application that knows when it is closed from the Task Manager and it can prevent it from happening
|
|
|
|
|
having viral thought or what?;P
check this out (im not sure about this):
use CreateThread() and check out the security descriptors; maybe these things are useful.
|
|
|
|
|
Hiii,
I want to control the individual pins of Serial port using VC++. I need to retrieve Data, Read/Write enable and Software driven Clock from it.
I've checked "Hardware Interface Programming in VC++ - Part I (Port Access) By Jaygiri". It's really good.
Waiting for the artical controlling Serial Port.
Plzzzzzzzzz reply as soon as possible.
|
|
|
|
|
see if this help
http://www.codeproject.com/system/serial.asp
for toggling pin, you may check handshaking stuffs and SetCommState api.
regards,
jim
|
|
|
|