|
Hi,
I have Dialog in a Property Sheet. I have a picture control on that dialog box. I have a Bitmap which I want to use on that Picture control. I am using the below code for this part:
if(::IsWindow(m_CapScreen.m_hWnd ))
{
tempbmp.LoadBitmapW(IDB_BMP_VIDEO_SCREEN_BOX);
tempbmp.GetBitmap (&bm);
m_CapScreen.MoveWindow( rt.left + 51, rt.top + 25, m.bmWidth, bm.bmHeight, 1 );
tempbmp.DeleteObject();
}
where m_CapScreen in a variable declared for picture control.
When I change the position of the picture control, the Bitmap Image doesn't move with the picture control. It will remain at a fixed position.
The "Type" property of Picture control is set to "Frame".
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|
|
I don't see the connection between the bitmap and the picture control in the above code. Does this paint the bitmap in the correct place to start with?
Use the best guess
|
|
|
|
|
Hi,
"m_CapScreen" is defined as,
DDX_Control(pDX, IDC_CAPSCREEN, m_CapScreen);
which is a picture control, it type property has beent set to "Frame". So it will act as a frame to the bitmap positioned on the dialog.
Or else plz give me any suggestion if we can stretch a bitmap.
Whenever I change the resolution of the PC, I want to change the size of the bitmap accordingly. I can change the position and size of the controls, but prob is with the Bitmaps, BMP size I can't change. So I was looking out any way for this.
Regards,
Mbatra
|
|
|
|
|
What MFC class is it and how are you adding the bitmap to it?
Use the best guess
|
|
|
|
|
I have 3 objects on the screen, I want to rotate onll 2 objects the axis and X,Y,Z. Another line is there which I want not to rotate. But with this code below all are moving. Check below my DrawScene function.
[code]
void CopenGLCoordView::DrawScene(CDC *pDC)
{
wglMakeCurrent(pDC->m_hDC, m_hrc);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (wd <= ht)
glOrtho(left, right, top*ht/wd, bottom*ht/wd, znear, zfar);
else
glOrtho(left*wd/ht, right*wd/ht, top, bottom, znear, zfar);
glPushMatrix();
glRotatef(rot[0], 1.0f, 0.0f, 0.0f);
glRotatef(rot[1], 0.0f, 1.0f, 0.0f);
glRotatef(rot[2], 0.0f, 0.0f, 1.0f);
glCallList(axes);
glPrintX("X");
glPrintY("Y");
glPrintZ("Z");
glPopMatrix();
drawLine(); //This is also moving...i want this to not to move...
glFlush();
SwapBuffers(pDC->m_hDC);
wglMakeCurrent(NULL, NULL);
}
[/code]
|
|
|
|
|
Hi,I want draw a combobox,the combobox has delete button in each item of listbox and edit control, I don't know how add it in edit control.
|
|
|
|
|
You need to implement the various drawing messages as described here[^].
Use the best guess
|
|
|
|
|
|
There is a link to some examples at the bottom of that page. One of those examples, http://msdn.microsoft.com/en-us/library/windows/desktop/aa390421(v=vs.85).aspx, shows how to call a provider method.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks for your suggestion, I tried this and its successful.
I did EnableDHCP and few others but on enable static it's not working.
on enable static IP address is to be there in an array(SafeArray).
Do you have any Idea?
Thanks!
|
|
|
|
|
|
|
Thanks for your reply. and however, LinearGradientBrush only draw gradient area on straight way. PathGradientBrush might be helpness, but Im not sure how to do with it.
|
|
|
|
|
At a guess you could use either brush type to flood fill a circle, then overpaint an inner circle in the background colour. That would give you the basic ring shape. You need to do some experimentation to figure out the optimum methods.
Use the best guess
|
|
|
|
|
Tab key and delete key is not working in browser control
|
|
|
|
|
Most interesting; do you have a question?
Use the best guess
|
|
|
|
|
|
venkatesh52867 wrote: these methods not calling please check my class Please do not do this, we cannot go through something like the above trying to figure out what is happening. Use your debugger to narrow down the problem area and post some more specific detail.
Use the best guess
|
|
|
|
|
Hi guys please I need your help to do a little code at the green comment line in order to do this:
when I try to add new element to an array
4 56 7 10
like 100 at 1 index position
will do this
4 100 7 10 56
it should be like this :
4 100 56 7 10
so the problem is i have to use swap making swap variable take value and them move the rest on order to make like this
4 100 56 7 10
#include<iostream >
using namespace std;
void printarray(int [], int,int );
void gradefull( int [],int ,int&);
void add(int [],int ,int) ;
void main(){
int * gradeArray;
int g;
int elmentnumber=0;
cout<<endl;
cout << "\tEnter the number of elemetn for the array: " ;
cin>>g;
gradeArray=new int[g];
gradefull(gradeArray,g,elmentnumber);
cout << endl ;
printarray(gradeArray,g,elmentnumber);
cout << endl<< endl ;
cout<<"Adding New Element:"<<endl<<endl;
add( gradeArray , elmentnumber,g);
cout << endl<< endl ;
system("pause");
}
void gradefull( int gradeArray[],int g,int & elmentnumber ){
cout<<endl;
for ( int i=0;i<g; i++ ){
int input;
cout << "please insert the element #<"<< i<<">: ";
cin>>input;
gradeArray[i]=input;
elmentnumber++;
}
}
void printarray(int gradeArray[], int g,int elmentnumber){
for ( int i=0;i<g; i++ ){
cout<<"\t"<<gradeArray[i] <<" ";
}
cout<<endl;
cout<<endl <<"\tYou entred <"<<elmentnumber << "> elments";
}
void add(int gradeArray [],int elmentnumber,int g ){
int temp;
elmentnumber++;
int newinput;
int indix;
cout<<endl;
cout<<" Please Enter the postion indix for the new element: ";
cin>>indix;
while((indix>elmentnumber)||(indix==elmentnumber)){
cout<<" Please Enter the postion indix for the new element: ";
cin>>indix;
}
for ( int i=0;i<elmentnumber; i++ ){
if ( i==indix){
temp=gradeArray[i];
cout<<endl<<"\tEnter the new element number: ";
cin>>newinput;
gradeArray[i]=newinput;
}
} cout<<endl;
cout<<" The new Array after Adding the New element: "<<endl<<endl;
if (indix<g){
gradeArray[elmentnumber-1]=temp ;
}
for ( int i=0;i<elmentnumber; i++ ){
cout<<"\t"<<gradeArray[i] <<" ";
}
}
modified 4-Mar-13 5:21am.
|
|
|
|
|
How could you possibly insert insert a new element without growing the array?
Have you thought about it?
By the way, do you know STL provides the vector container, that in turn provides the insert[^] method?
Veni, vidi, vici.
|
|
|
|
|
Your code does not adjust the position of the existing elements in the array. Your add function merely replaces the element at the specified entry. You need to allocate a new array with an extra element and move all the following items down when you add a new entry. However, you could save yourself a lot of trouble by using one of the STL Containers[^].
Use the best guess
|
|
|
|
|
oK how about now I did fixing !
|
|
|
|
|
You are still not addressing the problem correctly. You are trying to add an element into the array, so you need to increase its size first to accommodate the new entry. Your code is just overwriting two entries with different values. Try drawing the array on paper and see what you need to do to add a new value in the middle.
Use the best guess
|
|
|
|
|
but the code work prefect and fine what I need now only make some move to the index to order the values
did you run the code
because I did increase the size of array by calling the array and increase the size using this variable
elmentnumber++;
maybe you try to say something I have no idea about it. please tell if what i'm doing not Ok and please say the reasons
|
|
|
|
|
Eshoula Aswomwe wrote: I did increase the size of array by calling the array and increase the size using this variable Incrementing a variable does not change the size of the array. You need to create a new array and copy the values into it allowing an empty cell where the new value is to be added. Then you can add that new value into the empty cell.
Use the best guess
|
|
|
|