|
If you are referring to the creation of a bitmap file for the purpose of using it as a resource in the VC++ project, then click on the Add Resource menu-item on the Project menu. A dialog box called Add Resource will appear on the screen. Select Bitmap and then click on the New button. You'll get a blank bitmap file drawing area from where you can draw your own bitmap file.
As an alternative, you can draw your own bitmap file using some standard drawing software such as Paint and save it as bmp file and then click on the Import button in the aforesaid Add Resource window to import the same.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
I like to convert program's output into a bitmap file using program
by
KK
|
|
|
|
|
Krishna Kumar N wrote:
program's output
What is output by your program ? Is text that you want to print into a bitmap ? or do you get a raw buffer that you want to convert into a bitmap ? Pls give more details, otherwise it is difficult to help...
~RaGE();
|
|
|
|
|
My programs output contains text & graphics. Output is already displayed in screen. I like to create a Bitmap file of the output, without using Screen Capture technic (Alt + Print Screen).
I used CDC for displaying programs output
pls help
thanx in advance
by
Krishna Kumar
Krishna Kumar N (Volks)
|
|
|
|
|
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??
|
|
|
|