Click here to Skip to main content
15,919,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: is there any service which works like task scheduler? Pin
Banks K7-Nov-06 19:37
Banks K7-Nov-06 19:37 
GeneralRe: is there any service which works like task scheduler? Pin
Hamid_RT7-Nov-06 19:54
Hamid_RT7-Nov-06 19:54 
GeneralRe: is there any service which works like task scheduler? Pin
Banks K7-Nov-06 21:40
Banks K7-Nov-06 21:40 
GeneralRe: is there any service which works like task scheduler? Pin
Hamid_RT7-Nov-06 22:12
Hamid_RT7-Nov-06 22:12 
GeneralRe: is there any service which works like task scheduler? Pin
Banks K7-Nov-06 22:24
Banks K7-Nov-06 22:24 
GeneralRe: is there any service which works like task scheduler? Pin
Hamid_RT9-Nov-06 19:56
Hamid_RT9-Nov-06 19:56 
GeneralRe: is there any service which works like task scheduler? Pin
Blake Miller9-Nov-06 4:27
Blake Miller9-Nov-06 4:27 
QuestionHow to calculate - scaling ? Pin
dharani7-Nov-06 18:21
dharani7-Nov-06 18:21 
Hi all
I have a problem with scaling a bitmap in different DPI situations .
The problem is : I have a dialog box where a bitmap is statically present . So during runtime without calling LoadBitmap () this bitmap is loaded into the dialog with the default size which is same you see in dialog editor . But problem comes when I change system DPI from 96 to 120.
Now the dialog and all the controls behind the bitmap are resized while the bitmap remains the same. I tried to implement StretchBlt () to scale the bitmap to new size - I do not succeed as I do not know how to map it to new DPI . To pictorise it ...

................. <---- The parent dialog
. .
. |---------| .
. | |<-- Bitmap with original static size when DPI=96
. | | .
. | | .
. | | .
. | | .
. | | .
. |---------| .
. .
.................


Now what I want is , when I change DPI to 120 then it should resize itself *from* the top,left of original size to the new sized bitmap .
After implementing StretchBlt as below ..I got it stretched fully to windows limits not as I want ...
pBitmap->LoadBitmap(IDB_BITMAP_ADDON_10_NOE);
POINT ptSize;
GetClientRect(hDlg,&rect);
pBitmap->GetObject(sizeof(BITMAP), &bitmap);
ptSize.x = bitmap.bmWidth;
ptSize.y = bitmap.bmHeight;
fxFactor = ((float)ptSize.x/(float)(rect.right-rect.left)),
fyFactor = ((float)ptSize.y/(float)(rect.bottom-rect.top));
xOffs = ((long)rect.Width()-(long)(ptSize.x/fxFactor))/2;
yOffs = ((long)rect.Height()-(long)(ptSize.y/fyFactor))/2;

dc->StretchBlt(xOffs,
yOffs,
(long)(ptSize.x/fxFactor),
(long)(ptSize.y/fyFactor),
&dcTemp,
0, 0,
ptSize.x,
ptSize.y,
SRCCOPY);


Now we have the real width,height of the bitmap + the windows dimensions . I need the bitmap to be scaled evenly to the new dimension of dialog keeping this bitmap in the center of the dialog . So I need to calculate the coordinates of the new bitmap with following points
1) Coordinates of the windows( = Center point of window)
2) Height,Width of bitmap
Can anyone please advise me ?




redindian


redindian

AnswerRe: How to calculate - scaling ? Pin
Hamid_RT7-Nov-06 19:16
Hamid_RT7-Nov-06 19:16 
GeneralRe: How to calculate - scaling ? Pin
dharani7-Nov-06 19:24
dharani7-Nov-06 19:24 
GeneralRe: How to calculate - scaling ? Pin
Hamid_RT7-Nov-06 19:53
Hamid_RT7-Nov-06 19:53 
GeneralRe: How to calculate - scaling ? Pin
Hamid_RT9-Nov-06 19:57
Hamid_RT9-Nov-06 19:57 
QuestionEntrypoint problem in my project Pin
Raghavendra Pise7-Nov-06 18:06
Raghavendra Pise7-Nov-06 18:06 
AnswerRe: Entrypoint problem in my project Pin
Hamid_RT7-Nov-06 19:28
Hamid_RT7-Nov-06 19:28 
Questionmemeory leak with property sheets Pin
vikas amin7-Nov-06 18:00
vikas amin7-Nov-06 18:00 
QuestionRe: memeory leak with property sheets Pin
prasad_som7-Nov-06 18:10
prasad_som7-Nov-06 18:10 
AnswerRe: memeory leak with property sheets Pin
PJ Arends7-Nov-06 20:30
professionalPJ Arends7-Nov-06 20:30 
QuestionRe: memeory leak with property sheets Pin
David Crow8-Nov-06 3:50
David Crow8-Nov-06 3:50 
QuestionCListCtrl Virtual List Pin
kk.tvm7-Nov-06 17:51
kk.tvm7-Nov-06 17:51 
AnswerRe: CListCtrl Virtual List Pin
PJ Arends7-Nov-06 20:41
professionalPJ Arends7-Nov-06 20:41 
GeneralRe: CListCtrl Virtual List Pin
David Crow8-Nov-06 3:53
David Crow8-Nov-06 3:53 
QuestionRemove character from file Pin
Mohammad Khodaea7-Nov-06 17:50
Mohammad Khodaea7-Nov-06 17:50 
AnswerRe: Remove character from file Pin
kk.tvm7-Nov-06 18:05
kk.tvm7-Nov-06 18:05 
GeneralRe: Remove character from file Pin
Mohammad Khodaea7-Nov-06 19:31
Mohammad Khodaea7-Nov-06 19:31 
QuestionRe: Remove character from file Pin
David Crow8-Nov-06 3:56
David Crow8-Nov-06 3:56 

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.