|
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).
|
|
|
|
|
The program compiled succesfully but encountered an error in the constructor.
Error:
Unhandled exception: Access violation reading location 0x00000010.
pointing to atlsimpstr.h which is not my included in my source code.
|
|
|
|
|
Are you sure the exception is due to Image constructor. Have you debugged step into the Image constructor? When i did even though the path is not correct, i didn't get exception and it not directing to the source coded of atlsimpstr.h. I think it is not because of Image constructor. I suggest you to check the callstack which statement in your program leads to the exception and you can also debug the Image Constructor to verify.
|
|
|
|
|
Yes, I have debugged the code and error appears after the constructor line.
|
|
|
|
|
can you post the code snippet.
|
|
|
|
|
Why can't you just debug and find out the problem?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
So set a breakpoint in the constructor and single-step over each statement.
"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
|
|
|
|
|
Did you try without using L, I mean -
Image img("c:\\Sample.jpg");
|
|
|
|
|
Yes, and has a compiling error.
Error:
Cannot convert const char[10] to const WCHAR*.
|
|
|
|
|
Whenever an error occurs:
(1) Read the error message, usually it is quite descriptive.
(2) If after point (1) you're still in troubles then post here your code (you've already done it) and the error message itself (you haven't done yet).
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
|
|
|
|
|
checkout c:\\Sample.jpg on the right path or the splling of the image you r using correct.
Rajesh
|
|
|
|
|
|
By the way I have made this code work in other project.
Now I'm trying to integrate this to an open source project.
|
|
|
|