|
Hi,
I need help please, i have to use TStringList object so if someone has an example how to use it and what are files should include them because i have some problems to do like this :
TStringList *Liste = new TStringList;
thank you for your help
|
|
|
|
|
Please, let me Google that for you ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thank you for the search but i need examples in C++.
|
|
|
|
|
I can see C++ examples, in the results found.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok , can you give me some of them ?
|
|
|
|
|
can any body help me for, showing pop up window in taskbar..
like the way windows media players shows songs and visualisation in minibar(when its minimised).
|
|
|
|
|
What you need is a Deskband.
There are 4 types of deskband objects.
3 of them reside inside internet explorer.
The last one is on the desktop.
Look at the second image in the article Implementing Shell Desk Band and Internet Explorer Bars[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
In my app I have defined a dialog box with multiple static text items.
I am dynamically creating the dialog box when the user select a menu item.
I'm able to set the background color of the diaglog box by adding
ON_WM_CTRLCOLOR msg handler and calling m_brush.CreateSolidBrush in the
OnInitDialog(). I would like to set the color of the static text items on
the dialog box. How to do ? I know I need to use some type of CDC with
SetTextColor() API. I would like to set the color of these items when the dialog is created and also update some at run-time based on events happening in my app
Help, Windows/MFC "newbie"
|
|
|
|
|
See the Extras section of this article.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In the OnCtlColor handler in the dialog, look for CTLCOLOR_STATIC and then call the SetTextColor method of the CDC class like pDC->SetTextColor(...
Look at the documentation for CWnd::OnCtlColor[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
I'm looging to use my old Axim Pocket PC with PPS2003 OS as a clock and to not let it on 24/7 I'd like a option to let it turn on at let say 6:00 and of at 22:00 automatically.
|
|
|
|
|
|
Hi All,
I have a very large application that creates many dialogs. I have a CDialog derived class that skins dialogs. I would like to automatically make EVERY dialog in my application use this class - even message boxes, TWAIN interfaces etc etc. I was hoping I could simply use SetWindowsHookEx to do this but the problem that I'm having is that my dialogs are already 'CWnd' objects - when I try to subclass them as another CWnd (i.e. my Skinned Dialog class) I get assertations.
Is there any way to safely subclass a CDialog object with another CDialog object?
Thanks in advance,
Dave
|
|
|
|
|
You could use the CWnd::Detach method to detach the existing CWnd object and then use CWnd::Attach on the returned window handle to attach your CDialog derived class.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi all,
I'm working on creating an application which will acquire image data from a camera and display it.
I have right now acquired image data from camera. The data is in the form of long integer array (32-bit signed integers). I would like to visualise this data. I am not sure how to display the data as an image. Could you please help me?
I am using Microsoft visual studio C++ 2008.
Thanks
|
|
|
|
|
What is the format of that image data? Compressed, uncompressed, RGB values, BGR values? 8 bits per color component, 16 bits per color components, using a palette? Generally i guess you could create a dib section using CreateDIBSection[^] and try to render that image into the dib and then you can do whatever you like with it like blitting it onto a window.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Each pixel value is in the form of 32 bit. I understand the last 24 bits represent RGB values(8bits each) and the rest 8 bits are unused (value=0).
I am not sure how I can create a proper pixel palette to convert this image to bitamp and display it.
|
|
|
|
|
do you know the dimensions of the image?
i mean, pixels along x and pixels along y.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi yes i know the dimensions of the image ..Its 1004*1002
|
|
|
|
|
I supose you do know the dimensions of your image (width and height) so when you create a DIB in memory of that size, as the documentation states, you get a pointer to the first pixel and can start copying your pixel data performing conversion if needed.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi..
i know the dimensions of the image data. its 1004*1002. I created a DIB with CreateDIBSection. But the color information looks very different from the image which i obtained from the camera using its software. Right now my data is 32 bit (24bit RGB + 8bits unused). could u please advice me on how to convert the bit depth from 32bit to 8bit?
|
|
|
|
|
Why do you want to convert it to 8 bit? You can create 24 and 32 bit DIBs.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
The color imformation looks very different in the DIB which i have generated. I am not sure if i should use some color palette. Please find below the code which i used
HDC dc= CreateCompatibleDC(NULL);
BITMAPINFO info;
ZeroMemory( &info.bmiHeader, sizeof (BITMAPINFOHEADER) );
info.bmiHeader.biHeight = 1002;
info.bmiHeader.biWidth = 1004;
info.bmiHeader.biPlanes = 1;
info.bmiHeader.biBitCount = 24;
info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
info.bmiHeader.biClrUsed= 0;
info.bmiHeader.biClrImportant= 0;
long* pixels;
int Buffersize = 1004*1002;
HBITMAP hbmp= CreateDIBSection( dc,
&info,
DIB_RGB_COLORS,
(void**)&pixels,
NULL,
0 );
pixels = (long*) malloc(Buffersize*sizeof(long));
for(int j=0; j < Buffersize; j++)
{
pixels[j] = arr[j];
}
int nFile = _open ("c:\\Image.bmp", _O_CREAT | _O_TRUNC | _O_BINARY | _O_WRONLY, _S_IWRITE);
int nBitmapDataSize = (width * height * 3);
int nFileSize = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER) + nBitmapDataSize;
int nOffset = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER);
BITMAPFILEHEADER bmfh;
bmfh.bfType = ((WORD) ('M' << 8) | 'B');
bmfh.bfSize = nFileSize;
bmfh.bfReserved1 = 0;
bmfh.bfReserved2 = 0;
bmfh.bfOffBits = nOffset;
BITMAPINFOHEADER bmih;
memset (&bmih, 0, sizeof (BITMAPINFOHEADER));
bmih.biSize = sizeof (BITMAPINFOHEADER);
bmih.biPlanes = 1;
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biWidth = width;
bmih.biHeight = height;
_write (nFile, &bmfh, sizeof (BITMAPFILEHEADER));
_write (nFile, &bmih, sizeof (BITMAPINFOHEADER));
_write (nFile, pixels, nBitmapDataSize);
_close (nFile);
|
|
|
|
|
What are you trying to achieve here? If you wish to save your image you don't need a DIB section, i thought you wanted to display the image on some window for example, for that you could use the DIB, to save a bitmap to a file you can simply write the headers and the pixel data as you did without any device contexts or HBITMAPs. So let's forget the DIB and consider you just want to save the data to a bmp file. Explain what you mean by "looks very different". You should know that in a bitmap each scanline's bytecount has to be dividable by 4 otherwise your image will look disorted. To explain what i mean: you say your image's width is 1002 pixels. If you want a 24 bits per pixel bitmap, then every pixel is 3 bytes, right? So 1002 pixels is 1002 * 3 = 3006 bytes. 3006 / 4 = 751.5, so your scanlines do not occupy a multitple of 4 bytes. You need padding to overcome this, you have to add zeros to the end of each scanline till your scanline's bytecount can be divided by 4. So after you write 3006 bytes into the file for the RGB data you also need to write 2 additional bytes of 0, this way your scanlines will have 3008 bytes, which can be divided by 4 (752). You have to do this for each scanline. You should read about the bitmap file format here[^] or just google[^] a bit around.
Imho, you are better of trying to save a 32 bpp bitmap, since 32 bits are 4 bytes, your 1002 pixels on a scanline will occuppy 4008 bytes which is -obviously- dividable by 4.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
hii.
I am trying to display the image onto a window. But i'm not sure how to do it with DIB. So i just thought of saving it onto disk. Can u advice me on how to use DIB for displaying?
Actually the width of my image is 1004 and the height is 1002. So the width will be divisible by 4.
|
|
|
|