Click here to Skip to main content
15,909,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to Delete a class in visual c++? Pin
Christian Graus4-Aug-01 2:40
protectorChristian Graus4-Aug-01 2:40 
GeneralRe: how to Delete a class in visual c++? Pin
Reno Tiko4-Aug-01 15:50
Reno Tiko4-Aug-01 15:50 
GeneralRe: how to Delete a class in visual c++? Pin
Christian Graus4-Aug-01 17:33
protectorChristian Graus4-Aug-01 17:33 
GeneralRe: how to Delete a class in visual c++? Pin
Reno Tiko6-Aug-01 19:36
Reno Tiko6-Aug-01 19:36 
AnswerRe: how to Delete a class in visual c++? Pin
4-Aug-01 21:15
suss4-Aug-01 21:15 
QuestionHow To Use Progress in visual c++? Pin
nemati3-Aug-01 21:26
nemati3-Aug-01 21:26 
AnswerRe: How To Use Progress in visual c++? Pin
Christian Graus4-Aug-01 2:41
protectorChristian Graus4-Aug-01 2:41 
GeneralHelp: CWindowDC and CBitmap Pin
Craig Miller3-Aug-01 20:55
Craig Miller3-Aug-01 20:55 
Hi,

I'm trying to create an application similar to Mr. DiLascias' Virgil
application http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0397/c++/c++0397.htm&nav=/msj/0397/newnav.htm My application has one large difference, I've derived my view from a Dundas class called CScrollWnd which allows zooming of the image. The Dundas class loads the original bitmap and draws it out to the screen. When the user zooms the image, they use a CWindowDC to change the orientation of the image (zoom in/out). This is where I'm having a lot of trouble, when the original image is zoomed, I need to somehow change the orientation of the masked image. Since the Dundas class is already changing the orientation for me, I was wondering if I could just make the same changes to my masked image that the class is doing to the original image and then just update the masked image that's in memory. Is there a way to change a CBitmap the way that a CWindowDC is changed?

I hope I'm explaining this correctly, if not please don't hesitate to ask and I will try to explain it better. I'm new to dealing with this kind of programming and would appreciate any help you can provide.

Here is some sample code that I'm using in my application to try and find out where on the image they are pointing but as you can see, the mask image is loaded but it is always loaded at it's actual size and not what the actual zoomed image is set to.

void CMyImageViewer::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CDC dc;
dc.CreateCompatibleDC(NULL);

CSize sizeDIBMask = m_dibMask.GetSize();
CRect rectMask(0, 0, sizeDIBMask.cx, sizeDIBMask.cy);
CRect rectPaintMask = rectMask;
NormalToScaled(&rectPaintMask);
UINT diffMask = rectMask.bottom - rectMask.top;
rectMask.bottom = sizeDIBMask.cy - rectMask.top;
rectMask.top = rectMask.bottom - diffMask;

CRkFicheView *wnd = (CRkFicheView*)m_splitterWnd.GetPane(0, 1);
CRkImageViewer *pImageViewer = wnd->GetImageViewer();
CDib *pMask = pImageViewer->GetMaskDib();
CBitmap *pOldBm = dc.SelectObject((CDib*)&m_dibMask);
COLORREF color = dc.GetPixel(point);
dc.SelectObject(pOldBm);

TRACE("RGB(%d,%d) = (%d,%d,%d) \n", point.x,
point.y, GetRValue(color), GetGValue(color), GetBValue(color));

if(color != RGB(255, 255, 255)) //white = nothing
{
AfxMessageBox("Color other than white found.");
}

COXScrollWnd::OnMouseMove(nFlags, point);
}


Thanks,

Craig
GeneralRe: Help: CWindowDC and CBitmap Pin
Paolo Messina5-Aug-01 6:15
professionalPaolo Messina5-Aug-01 6:15 
GeneralRe: Help: CWindowDC and CBitmap Pin
Craig Miller5-Aug-01 8:13
Craig Miller5-Aug-01 8:13 
GeneralRe: Help: CWindowDC and CBitmap Pin
Paolo Messina5-Aug-01 10:59
professionalPaolo Messina5-Aug-01 10:59 
GeneralRe: Help: CWindowDC and CBitmap Pin
Craig Miller5-Aug-01 11:06
Craig Miller5-Aug-01 11:06 
QuestionHow do I add to the Outlook Express Contacts pane from MY program(s)? Pin
Jason Whelan3-Aug-01 18:06
Jason Whelan3-Aug-01 18:06 
GeneralRun-Time Query !!! Pin
Hadi Rezaee3-Aug-01 18:04
Hadi Rezaee3-Aug-01 18:04 
GeneralRe: Run-Time Query !!! Pin
3-Aug-01 22:49
suss3-Aug-01 22:49 
Generalsimple multiline edit ctrl Pin
Jake Palmer3-Aug-01 17:36
Jake Palmer3-Aug-01 17:36 
GeneralRe: simple multiline edit ctrl Pin
Michael Dunn3-Aug-01 18:36
sitebuilderMichael Dunn3-Aug-01 18:36 
GeneralRe: simple multiline edit ctrl Pin
Jake Palmer4-Aug-01 20:01
Jake Palmer4-Aug-01 20:01 
GeneralRe: simple multiline edit ctrl Pin
Paolo Messina5-Aug-01 6:20
professionalPaolo Messina5-Aug-01 6:20 
GeneralCListCtrl Question Pin
3-Aug-01 12:25
suss3-Aug-01 12:25 
GeneralRe: CListCtrl Question Pin
Michael Dunn3-Aug-01 13:11
sitebuilderMichael Dunn3-Aug-01 13:11 
QuestionHow to simulate RButtonDblClik with mouse_event()? Pin
3-Aug-01 10:42
suss3-Aug-01 10:42 
AnswerRe: How to simulate RButtonDblClik with mouse_event()? Pin
Paolo Messina3-Aug-01 11:54
professionalPaolo Messina3-Aug-01 11:54 
Generalfile copying -- help please Pin
Ganesh Ramaswamy3-Aug-01 10:07
Ganesh Ramaswamy3-Aug-01 10:07 
GeneralFont Combo Box Pin
3-Aug-01 9:12
suss3-Aug-01 9:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.