|
The error message was Unhandled exception in decoder.exe(GDI32.dll): 0xc0000005 : Access Violation
the declaration for ppbits was void **ppbits.
Once this CreateDIBSection works i thought of filling ppbits with pixel values. That's why that particular piece of code is not available
|
|
|
|
|
jossion wrote: the declaration for ppbits was void **ppbits
The above is wrong.
You have to declare a pointer to void, for instance
void * pbits;
and then pass the address of the pointer (i.e. &pbits ) to CreateDIBSection :
CreateDIBSection(hDC,bitmap,DIB_PAL_COLORS, &pbits, NULL,0);
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
|
|
|
|
|
Hello evry body, how is it possible to flash the icon of a certain frame window, in order to capture the attention of the user and see the asynchrounous event that happened and which relates to the frame whose icon is highlighted ?
Thank you in advance.
|
|
|
|
|
See FlashWindow()[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thank you thank you very much !
|
|
|
|
|
You're welcome.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I'd like to search the active window's client area for a given string and highlight it.
I've done this in VB using SelStart and SelLength.
I'm sure I've seen the same functionality available from a conventional Windows program, but can't remember what the win32 API calls are.
Does anyone know, or have tips on how to find out?
Thanks for the assist.
glyfyx
|
|
|
|
|
There is EM_SETSEL message though it works with edit boxes (or EM_EXSETSEL , with Rich Edit controls). AFAIK VB6 itself allows SelStart and SelLength only inside controls (i.e. they are TextBox methods).
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
|
|
|
|
|
Just a word of thanks - appreciated!
glyfyx
|
|
|
|
|
If this is a Win32 application without using MFC, create window as a child of the main window; use "edit" window class. You may want to subclass edit window but it is not necessary.
Use EM_* messages to tell edit window what to do. See MSDN for more information. EM_ messages are defined in WINUSER.H. Handle notification messages from control in a parent window, to see what control is doing. Notification code are also defined in WINUSER.H and are delivered as parameter of WM_COMMAND message.
For MFC application use CEdit class and call SetSel member function. Again, see MSDN for members reference. You can add notification handlers in a parent of edit control using Wizard.
JohnCz
MS C++ MVP
|
|
|
|
|
Thanks for taking time to provide such a complete answer - much appreciated!
glyfyx
|
|
|
|
|
You are very welcome. Glad to be of help.
JohnCz
MS C++ MVP
|
|
|
|
|
Hi
I want to insert the picture in the picture control in VC++ 6......
tell me how to do it
AbidBhat
|
|
|
|
|
Steps:
1) Add a .bmp image into resources,
2) Add a Picture Control onto the dialog template with the dialog editor,
3) Assign the resource ID of the image to the property of the Picture Control.
Maxwell Chen
|
|
|
|
|
|
If you want to insert bmp you can use of resource of program or for other foramts like jpg you can use of CImage class or GDI+.
|
|
|
|
|
Hamid. wrote: for other foramts like jpg you can use of CImage class or GDI+.
can u plz elaborate the procedure for doing this a little more....
thanx in advance ....
|
|
|
|
|
Not problem for read bmp files you can use of LoadImage and its simple to use for read other formats like jpg you can use like this
#incldue AtlImage.h
CImage m;
m.Load("c:\\1.jpg");
m.BitBlt(...);
and in the last use of m.Destro();
|
|
|
|
|
The simplest way is to create bitmap in the resource editor.
So-called picture control is nothing but a static control that has (among others) SS_BITMAP style.
Once you insert control and choose appropriate style, choose Bitmap type in a property box and assign ID of the bitmap image you want to display using the same property box.
That is all you need to do unless you want to customize display and control how images are displayed.
JohnCz
MS C++ MVP
|
|
|
|
|
dear all
for (int iiY=0;iiY<width;iiy++)>
{
for (int iiX=0;iiY<height;iix++)>
{
for (int kk=0;kk<3;kk++)
{
ucImgdata[iiY]=ucImagdata[iiY-1]*mask[kk];
}
}
}
my problem is how to get the following loop:
ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];
Li Zhiyuan
|
|
|
|
|
First - Your for loops are incomplete.
You can achive the same using the following loop -
int testval = 0;
for (int i = -1, int j = 0; i < 3; i++, j++)
{
testval += ucImagedata[iiY + i]*mask[j];
}
|
|
|
|
|
Did you follow the advice of other users here and buy a book?
Having read through some of your posts it would appear that you are lacking some basic C/C++ knowledge. You're basically banging your head against a wall hoping to punch through if you do it long enough. It's not going to happen until you get yourself the right tools.
|
|
|
|
|
li zhiyuan wrote: for (int iiY=0;iiY
{
for (int iiX=0;iiY
Did you bother to preview these before posting to make sure they looked right?
li zhiyuan wrote: my problem is how to get the following loop:
ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];
That is not a loop.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I'm encountering an error in constructiong an Image class.
For example:
Provided that gdiplus is included.
Image img(L"c:\\Sample.jpg");
the error points out to atlsimpstr.h.
Hope somebody can spare some comment.
It will be appreciated. Thank You.
|
|
|
|
|
And what is the exact error ? Some info might help us, we still can't read what's written on your screen (altough we are trying hard).
|
|
|
|