Visual C++ :: Zoom In Using Picture Control?
Aug 13, 2013
I'm have a bitmap that's about 4000x2000. But I want to put it all into a picture control. I attempted to use stretchBlt() to shrink it. But it did not work.
Code:
HBITMAP originalImage = CreateDIBitmap(m_picture1.GetDC()->m_hDC,
m_bmiHeader,
CBM_INIT,
(unsigned short *)m_OriginalBits,
[Code]....
View 3 Replies
ADVERTISEMENT
Apr 25, 2014
I was loaded a bitmap using this code. I'm using mousemove method to known the Dialog's mouse move position & get the RGB pixel.
I want to get the picture contol's mouse move position & using this point (x,y) i will get the particular color ref value R, G, & B.
My picture control size is 256 * 256 & I was loaded an image 512 * 512.
Using scroll bar, I was view the image but can't get the particular pixel in the picture control.
The below code get the Dialog's mouse move cursor position & RGB Values only.
Code:
void CMyDlg::OnMouseMove(UINT nFlags, CPoint point) {
int R,G,B;
COLORREF ref;
ref = m_dcMem.GetPixel(point.x,point.y);
R = GetRValue(ref);
G = GetGValue(ref);
B = GetBValue(ref);
CButton::OnMouseMove(nFlags, point);
}
How can i get the picture contol position even use the scroll bar.
View 1 Replies
View Related
May 29, 2014
I am working on a MFC application that I used for Image Analysis. I have a FrameWnd called MillChart that I use to generate an Image. This window is displayed at the run time in the application and not a part of the GUI dialog. It automatically resizes according to the different monitor resolutions and because of this there is a lot of empty space to the right of the MillChart. I was planning to add a picture control in the GUI dialog and redirect whatever is displayed in the MillChart to the Picture Control so that I can place my other elements (checkboxes, scrollbars etc) that I use in my app close to this MillChart and also set the size of the MillChart to a constant size.
Here is the code for positioning the elements (Note: I have only shown the MillChart position)
Code:
void CMainFrame::PositionElements()
{
CRect r, r2, r3;
GetClientRect(&r);
int mcs = r.Height() - r2.Height();
mMillChart->MoveWindow(r.right - r2.Width(),r.top + r2.Height(),mcs,mcs);
[Code] .....
View 1 Replies
View Related
Apr 19, 2013
I have made a complete solar system with key action for zoom in zoom out, moving along x, y, z axes on plus or minus and going up/down/right/left. I am now in a bit of a dilemma. I want to add a text window ( i have made my project in visual studio 2010 in win32 console application) where to put a text like a description of each planet to appear when i hit the left mouse button. E.g. When i click with the left mouse button the Venus planet I want a description to appear in my text window. However I don't know how to put make a text window and how to correctly define the picking methods... for now everywhere i hit the mouse button it appears in to the console that i hit the sun.
View 10 Replies
View Related
Jan 16, 2015
I get a task: to color the control scrollbar (a gridctrl scrollbar, whatever). In the first attempting I didn't succeded ... So, I started to trying coloring a CListBox scrollbar ... I developed a derived CListBox where I override OnCtlColor:
Code:
HBRUSH CMyListBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) {
HBRUSH hbr = CListBox::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
if(CTLCOLOR_STATIC == nCtlColor) {
pDC->SetTextColor(RGB(200, 34, 0));
[Code] ....
I colored everything, except scrollbars ) ... I attached the app demo ...
I already tried this solution: [URL] ....
but in my case, didn't worked ...
My question is, how can I color the control scrollbar ? It is possible ? If yes, how ?
View 14 Replies
View Related
Sep 21, 2013
I want to control my toolbar dynamically.
First I added tool bar with style including TBSTYLE_EX_MIXEDBUTTONS | TBSTYLE_LIST.
Then added the tool bar to a rebar. I added tool tips by handling TTN_GETDISPINFO.
Everything works fine. But when I try to add text to right of the button, the text
gets added but button size is not automatically changing.
The following code is not working .
void SetToolbarText(HWND& hwndToolbar,LPTSTR szText)
{
ATLASSERT(::IsWindow(hwndToolbar));
TBBUTTONINFO tbbi = { 0 };
tbbi.cbSize = sizeof(TBBUTTONINFO);
tbbi.dwMask = TBIF_TEXT;// | TBIF_SIZE;//if I add TBIF_SIZE code will work!
tbbi.cchText = 0;
tbbi.cx = 200;
[Code]...
View 1 Replies
View Related
Feb 4, 2015
I have a mfc project with a List Control (Report View).
When I run the project, the list control appears in the middle of the window instead of appearing where I placed it.
Is there a qay to make it stay where I need it?
View 2 Replies
View Related
Nov 30, 2014
I have a child window above an edit control.
When the position of the control in the parent in the child on top of it is clicked the control gets topmost. Is there any way to prevent this?
View 3 Replies
View Related
Feb 18, 2014
I need Edit Box and List Box controls on the Parent Window or Main Window of my application. I know how to use them in dialogs ..
I will need to Read/Write/Modify data from Edit Box . How to do this ?
View 4 Replies
View Related
Jul 10, 2013
I forget how to know when mouse is over controls in dialog.. I want to show a message in status bar when mouse over each control...
View 1 Replies
View Related
Mar 16, 2014
Im trying to Uncheck a Checkbox control with following code.
Code:
else if((point.x >= (rcRememPass.left - 4) && point.x <= rcRememPass.right) && (point.y >= rcRememPass.top && point.y <= rcRememPass.bottom))
{
if(m_CheckBoxRemem.GetState() == BST_CHECKED)
m_CheckBoxRemem.SetCheck(0);
else
m_CheckBoxRemem.SetCheck(1);
}
Above code snippet is from OnLButtonUp(). Whereas else part working good why the if part is failing to uncheck the box ?.
View 3 Replies
View Related
Feb 17, 2014
Special behaviour of a CEdit-control in a CDialogBar:
My CDialogBar is a member of my MDI-mainframe-class. The menu of the mainframe have an item with an accelerator "r".
Now, if I want to type the letter "r" in my CEdit-control, the menu-item (with the accelerator "r") will be called.
How can I type "r" into the CEdit-control? How can I handle it?
View 2 Replies
View Related
Jan 31, 2013
I am trying to populate a list control with the filename and maybe some other thing when i push the OK button....
Code:
void CThisDlg::OnOK() {
int iItem = 0, iActualItem = 0;
HANDLE hFind;
WIN32_FIND_DATA data2;
int iNum = 0;
hFind = FindFirstFile("*.*", &data2);
[Code] ....
When i push ok, no files get loaded. I also attached a image
View 13 Replies
View Related
Jan 28, 2014
In a MDI-app with some toolbars and statusbar I created also a controlbar which can be docked to the left side. My problem now: how do I get the exact height of the controlbar?
In CalcDynamicLayout I set the height for the docked state to the height of the mainframe. This value is too big, but it will work basically.
But how can I get the exact height of the controlbar?
View 4 Replies
View Related
Oct 21, 2012
I'm writing an ActiveX control. In one of the functions I'd like the user to be able to pass me a pointer to a buffer that they created which I can then fill with data and return a success/error code. What's the appropriate way to do this? I was thinking about just using an OLE_HANDLE type for the parameter and then casting that to pointer inside the OCX but I'm not sure if that's safe or the right way to do it.
View 2 Replies
View Related
Jun 20, 2013
I am using a slider control on a dialog box. I have handled OnLButtonDown for Slider control. But I wonder its not getting called whenever I click on the slider thumb, instead it gets called when I click anywhere on the dialog.
I want to handle OnLButtonDown when I click on the slider thumb.
View 6 Replies
View Related
Aug 29, 2014
There is a list control in Windows.
When I create a list control I can assign an image list to it with the ListView_SetImageList().
By default, when just created there is no image list assigned as can be checked with ListView_GetImageList().
Now, what should happen when I do following call:
Create list control.
Create an image list
Get the current image list
Assign an image list to list control
Display some items
Assign an old image list to list control.
Does strings on the list control should be indented?
View 4 Replies
View Related
Aug 10, 2014
ON_WM_CTLCOLOR(...) works for all the other controls but not the tab control.
Code:
void CEasyWebStoreUploaderDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB_CTRL, m_tabCtrl);
DDX_Text(pDX, IDC_EDIT_STATUS, m_strServerStatus);
DDX_Text(pDX, IDC_EDIT_UPLOAD_RESULTS, m_strUploadResults);
}
View 8 Replies
View Related
Mar 15, 2015
i want to design a custom control (Ui widget library) , this library can be used by any IDe developer to develop his UI.
how to design a custom control library and plug in.
View 11 Replies
View Related
Oct 22, 2012
Here is an imgur link to my current homework. [URL] .....
As you can see on there I have them listed on which ones are supposed to be sentinel and which ones are supposed to be count control loops. This is currently what I have:
Code:
#include <iostream>
#include <cmath>
#include <iomanip>
#include <fstream>
using namespace std;
void main() {
int count = 0;
int sum = 0;
[Code] ....
This class has me stumped currently and I am having a hard time breezing through the class at my instructors speed. So I don't want to get too far behind.
Right now this program is giving me an error that opens CMD and gives me infinite lines of "0's".
View 14 Replies
View Related
Jun 23, 2013
This is what I try to achieve:
1. Using a CScrollView as the View class type.
2. Using Document/View Architecture.
3. Insert multiple Common Controls such as CEdit, CButton, CListCtrl into the View dynamically.
4. All the Common Controls is base on a template created by user. So I do not know the quantity of the Common Controls.
This is the plan on how to do it:
1. In View OnInitialUpdate(), read the template to get all necessary info on the Common Controls to be create.
2. In View OnInitialUpdate(), create all Common Control. Some Common Control may not have WS_VISIBLE as it may not needed at initial stage.
3. In View OnUpdate(), I need to refresh the Common Control properties such as is its text, position or its visibility. This should happen if Document call UpdateAllView().
My Question:
1. Is this a normal & useable plan?
2. Do I miss other functions for any other messages?
3. Still wondering if I need to involve any coding in OnDraw() for this plan.
View 1 Replies
View Related
Aug 7, 2013
How would I go about selecting a subitem in a listview control with just pure Win32 API? I know it's possible with MFC... but I can't use MFC for this project. Right now, when you click on a subitem , it selects only the first column of the row . I used the following by referring internet. But its not working.
HTML Code:
iSlected=SendMessage(hList,LVM_GETNEXTITEM,-1,LVNI_FOCUSED|LVNI_SELECTED);
ListView_SetItemState(hList,iSlected,LVIS_FOCUSED|LVIS_SELECTED,0x000F);
View 5 Replies
View Related
Apr 26, 2014
I have a tabbed dialog with a couple of Separate dialogs. I created classes of CDialog for each dialog. Im trying to get the text from the edit control from the tabbed dialog and it appears in a message box when I press a button on the main dialog.
Code:
myDialog test;
test.UpdateData(TRUE);
CString bla = test.m_edit1;
test.UpdateData(FALSE);
MessageBox(bla,bla,MB_OK);
The m_edit is a variable of CString for the edit box
it gives me a error and crashes.
How do I get the text from the other dialogs edit control?
View 8 Replies
View Related
Jan 22, 2014
I want to show a list of graphical items in 1 or 2 columns (user selected). I will draw the items (owner-draw). I tried many hours today to find a solution with clistctrl. Is it possible to make it with clistctrl?
View 14 Replies
View Related
Feb 20, 2013
I am writing a GUI application with C++ Visual component Libraries and Win32API under windows OS.
As part of this app, I have to change color of the MS Windows button control depending on the external state.
I understood, Win32 will not support changing button control color directly as it will not support for this.
how to change the button color?
View 2 Replies
View Related
Jan 29, 2013
How do I get the path for a selected item in a list control?
View 5 Replies
View Related