|
one of solutions, you use CBitmmap copy CDC to CBitmmap ==> Safe to file.
|
|
|
|
|
Try with CImage object.
Use BitBlt or StretchBlt to copy the displaying programs output between DCs.
Use CImage::Save to save on HD the image (bmp, jpg, gif ,...).
|
|
|
|
|
Dear all,
I'm using VC++6.0. In my application, I have a Rich Edit Control (CRichEditCtrl) in a dialog. How can I set background color of my Rich Edit Control the same to color of the dialog at run time
|
|
|
|
|
For setting BG color of the RichEdit, check this[^]
|
|
|
|
|
Dear Dreamz,
It's easy to set the BG color of a RichEdit Control. What I want to do is get BG color of a dialog (at run time) and then set it to BG color of RichEdit Control.
|
|
|
|
|
overide OnPaint of dialog
use following code
CPaintDC dc(this);
COLORREF rf=dc.GetBkColor();
m_rEdCtrl.SetBackgroundColor(FALSE, rf);
|
|
|
|
|
I had tried, but it had not met my requirement. I tried GetSysColor and it worked. Thank you prasad_som
|
|
|
|
|
Hi
I need random number generator(C++).
In my case, RN generator must to generate random number every second.
How can i decide it?
If you have any suggestion, help me pls
Help me
|
|
|
|
|
srand((unsigned) time(0)) -- initialize random number generator
on a timer do
int myNumber = rand();
NG
|
|
|
|
|
hi
i wanted to know is there any API or MFC class for playing sound???
i want to play a .midi file and a .wav file.
would you enumerate them and i will check them .
thx
|
|
|
|
|
DirectShow API
PlaySound() function for wav sounds
MCI for midi...
NG
|
|
|
|
|
Respected all
I want to capture the bitmap(the client area of window on which bitmap is residing) which is dispaying when i executed my program and store it in temorary storage as "abc.bmp"(let say).
and then take print of abc.bmp.
Plz help me.very urgent needed.
Thanking u people
david
|
|
|
|
|
you can find here on codeproject
1: Window Capture
2: DDB to DIB
3: SaveDibToFile()
4: Create a printerDC
5: Bitblt the bitmap on the dc
6: EndDocument() --- print
that are the steps...
NG
|
|
|
|
|
Hi,
I use DrawFocusRect to draw the focus rectangle of a owner drawn button. I need to change the color of focus rectangle. How can I do it?
Thanks.
- NS -
|
|
|
|
|
Change the system colors. See ::SetSysColors . The color of the focus rectangle surely is one of the system colors.
--
The Blog: Bits and Pieces
|
|
|
|
|
Sorry, that is not applicable.
Because I use a owner draw button. I only need to change it only. If I change the system color, it will also affect the buttons that do not have owner draw style (I think so!).
Is there any other methods?
- NS -
|
|
|
|
|
Nishad S wrote:
If I change the system color, it will also affect the buttons that do not have owner draw style
Of course. But ::DrawFocusRect is a Win32 API, and as such it'll use the system colors (I don't bet on it - it might just XOR black with the HDC pixels). So, if it doesn't do what you want, don't use it.
Nishad S wrote:
Is there any other methods?
Draw the rectangle yourself, of course.
--
The Blog: Bits and Pieces
-- modified at 4:33 Wednesday 21st September, 2005
|
|
|
|
|
Thank you.
I tried it. But the built in pen styles do not match focus rect line (dotted line).
And creating a user style pen is a complex one, isn't it?
Can you explain the neccessary steps to create a pen just for drawing dotted lines (for focus rectangle)?
- NS -
|
|
|
|
|
Nishad S wrote:
create a pen just for drawing dotted lines
Literate programming:
::CreatePen(PS_DOT, 1, color);
--
The Blog: Bits and Pieces
|
|
|
|
|
Sorry, the result is not exactly as the DrawFocusRect do.
I did the following...
CPen pen(PS_DOT, 1, RGB(255,128,0));
CPen* pOldPen = dc.SelectObject(&pen);
dc.Rectangle(&rt);
The dots are little longer!!!
- NS -
|
|
|
|
|
hi all
i want to load a bitmap from a dll.
i did these:
0- loadlibrary
1- findresource
2- loadresource
3- lockresource
in the last step i get a LPVOID (according to MSDN it is a pointer to the first bit of the resource. i don know what to do after that and how to display it. . does anyone know how should i get this LPVOID to a CBitmap to view it??
oh, am i doing the right thing to load a resource from a dll??
|
|
|
|
|
If it's really a bitmap (BMP), then use ::LoadBitmap or ::LoadImage instead. They do all the other stuff plus more internally for you. If it's a raw RGB stream you have as a resource, then plug that void* into ::CreateDIBSection or ::CreateDIBitmap .
--
The Blog: Bits and Pieces
-- modified at 1:35 Wednesday 21st September, 2005
|
|
|
|
|
I really need some example and guide about how to program a sending data under mewtocol command messasge using TCP/IP. Can someone help me.
|
|
|
|
|
Does anyone know how to get the private memory usage of my program (e.g. "Private Bytes" in the Performance tool).
Thanks!
|
|
|
|
|
Find your 'process' by name, and then under items to add select the Private Bytes to the graph.
|
|
|
|