How to move Bitmap in Dialog ?
-
Dear Excellence: I want to move the bitmap in Dialog by presseing button, can you show me how to do it? Thanks. Morris X| Morris Pan
-
Dear Excellence: I want to move the bitmap in Dialog by presseing button, can you show me how to do it? Thanks. Morris X| Morris Pan
In the handler for the button press, put something along these lines: RECT stNewPosition; // setup the new position for the bitmap (this can also resize it) stNewPosition.top = 50; stNewPosition.left = 50; // etc... // this moves the bitmap only GetDlgItem(IDB_YOUR_BITMAP)->MoveWindow(&stNewPosition, TRUE); I think you can move the image off your dialog with this - effectively making it vanish so beware. Regards, Simon
-
In the handler for the button press, put something along these lines: RECT stNewPosition; // setup the new position for the bitmap (this can also resize it) stNewPosition.top = 50; stNewPosition.left = 50; // etc... // this moves the bitmap only GetDlgItem(IDB_YOUR_BITMAP)->MoveWindow(&stNewPosition, TRUE); I think you can move the image off your dialog with this - effectively making it vanish so beware. Regards, Simon
Dear Simon : Got it. Many thanks. Morris:) Morris Pan
-
In the handler for the button press, put something along these lines: RECT stNewPosition; // setup the new position for the bitmap (this can also resize it) stNewPosition.top = 50; stNewPosition.left = 50; // etc... // this moves the bitmap only GetDlgItem(IDB_YOUR_BITMAP)->MoveWindow(&stNewPosition, TRUE); I think you can move the image off your dialog with this - effectively making it vanish so beware. Regards, Simon
Dear Friend: Thank you first. It comes another question for me. How come if I want to move Bitmap by implementing the DC ? Can you please show me the way? Thanks Morris:confused: Morris Pan
-
Dear Friend: Thank you first. It comes another question for me. How come if I want to move Bitmap by implementing the DC ? Can you please show me the way? Thanks Morris:confused: Morris Pan
If by DC, you mean device context, I am sorry but I don't know as much about this as I always use move window. However, I know to get the device context you would do: CDC * pDeviceContext = NULL; pDeviceContext = GetDlgItem(IDC_YOUR_CONTROL)->GetDC(); Then you'll have to look in the MSDN for a CDC function that moves the image. Regards, Simon