Click here to Skip to main content
16,011,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is there any way to monitor all Paste Operation? Pin
Prakash Nadar19-May-04 23:57
Prakash Nadar19-May-04 23:57 
GeneralRe: Is there any way to monitor all Paste Operation? Pin
Anthony_Yio20-May-04 0:58
Anthony_Yio20-May-04 0:58 
GeneralRe: Is there any way to monitor all Paste Operation? Pin
David Crow20-May-04 3:00
David Crow20-May-04 3:00 
AnswerRe: Is there any way to monitor all Paste Operation? Pin
bikram singh20-May-04 4:54
bikram singh20-May-04 4:54 
Generaluplod on Amazon... Pin
Sumit Kapoor19-May-04 19:45
Sumit Kapoor19-May-04 19:45 
Questionhow to delete files(txt) from vc++ program Pin
shiva shankar19-May-04 19:33
shiva shankar19-May-04 19:33 
AnswerRe: how to delete files(txt) from vc++ program Pin
bugtwo19-May-04 20:16
bugtwo19-May-04 20:16 
Generalproblem drawing stretched image Pin
nm_11419-May-04 19:11
nm_11419-May-04 19:11 
I'm trying to draw a stetched image, but only the part that need updating, with the following code:
if (IntersectRect(&rcIntersected, &ps.rcPaint, &rcImgScrolled))
{
	float rx = (float)ImgWidth / (float)ZoomedImgWidth;
	float ry = (float)ImgHeight / (float)ZoomedImgHeight;

	int dl = rcIntersected.left - ps.rcPaint.left;
	int dt = rcIntersected.top - ps.rcPaint.top;
	int dw = RECTWIDTH(rcIntersected);
	int dh = RECTHEIGHT(rcIntersected);
	int sl = int(float(rcIntersected.left - rcImgScrolled.left)*rx);
	int st = int(float(rcIntersected.top - rcImgScrolled.top)*ry);
	int sw = int(float(RECTWIDTH(rcIntersected))*rx);
	int sh = int(float(RECTHEIGHT(rcIntersected))*ry);

	StretchBlt(hDCBuffer, 
		dl, dt, dw, dh,
		hDCCurImg, 
		sl, st, sw, sh,
		SRCCOPY);
}

The problem is when the window is at certain sizes (the zoom is scaled to the window), the last row or column isn't drawn.
I know it's because of the floats being rounded off, but how do you fix so it gets the exact number of pixels needed?
I tried floor() which had no effect, and ceil() which would sometimes draw an extra row or column of random colors...
-thanks
Generalvcpp6 keeps hanging Pin
closecall19-May-04 17:16
closecall19-May-04 17:16 
GeneralVisual Studio .NET vs old mfc class Pin
zecodela19-May-04 17:09
zecodela19-May-04 17:09 
GeneralRe: Visual Studio .NET vs old mfc class Pin
Christian Graus19-May-04 17:27
protectorChristian Graus19-May-04 17:27 
GeneralRe: Visual Studio .NET vs old mfc class Pin
Michael P Butler19-May-04 22:36
Michael P Butler19-May-04 22:36 
GeneralCombo Boxes and numbers Pin
Eversman19-May-04 16:56
Eversman19-May-04 16:56 
GeneralRe: Combo Boxes and numbers Pin
Mahendra_78619-May-04 21:33
Mahendra_78619-May-04 21:33 
GeneralRe: Combo Boxes and numbers Pin
Andrew Quinn AUS19-May-04 23:50
Andrew Quinn AUS19-May-04 23:50 
GeneralShowWindow() problem - MFC Pin
J.B.19-May-04 16:21
J.B.19-May-04 16:21 
GeneralRe: ShowWindow() problem - MFC Pin
nguyenvhn19-May-04 18:18
nguyenvhn19-May-04 18:18 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.19-May-04 18:57
J.B.19-May-04 18:57 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 2:23
*Dreamz20-May-04 2:23 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.20-May-04 3:26
J.B.20-May-04 3:26 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 3:34
*Dreamz20-May-04 3:34 
GeneralRe: ShowWindow() problem - MFC Pin
J.B.20-May-04 5:16
J.B.20-May-04 5:16 
GeneralRe: ShowWindow() problem - MFC Pin
*Dreamz20-May-04 19:21
*Dreamz20-May-04 19:21 
GeneralA probelm of launching excel from C++ Pin
xiaosongxia19-May-04 16:18
xiaosongxia19-May-04 16:18 
GeneralRe: A problem of launching excel from C++ Pin
Steve S19-May-04 22:37
Steve S19-May-04 22:37 

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.