b_harpal
asked on
bitmpas loading..using SetTimer..
hi,
i want to load 10 bitmaps.At the same position these bitmaps should come one after the other ..using SetTimer.it should form a loop.Bitmaps
are displayed full window..
i want to load 10 bitmaps.At the same position these bitmaps should come one after the other ..using SetTimer.it should form a loop.Bitmaps
are displayed full window..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi Krisp,
thanks for your answer.But somehow iam still not able to implement it fully.It's giving problems in the OnPaint() function.It would be kind of u if u can give the full code so that i can cross-check it & solve my problem. Your answer helped me solve 95% of my problem..
waiting for reply..
cheers..
thanks for your answer.But somehow iam still not able to implement it fully.It's giving problems in the OnPaint() function.It would be kind of u if u can give the full code so that i can cross-check it & solve my problem. Your answer helped me solve 95% of my problem..
waiting for reply..
cheers..
Why don't you try the following code to draw the bitmap. Hope it will help :
width = the width of your screen in pixels
height = the height of your screen in pixels
CBitmap cbmp;
cbmp.LoadBitmap(IDB_BITMAP );
HBITMAP Bmp;
Bmp=(HBITMAP)cbmp;
BITMAP bm;
GetObject(Bmp, sizeof(bm), &bm);
CPaintDC dc(this);
HDC memdc = CreateCompatibleDC(NULL);
HBITMAP h = (HBITMAP)SelectObject(memd c, Bmp);
StrectchBlt(dc,0,0,bm.bmWi dth,bm.bmH eight,memd c,0,0,widt h,height,S RCCOPY);
SelectObject(memdc, h);
I don't have any intention to cross krips, just trying to help, krips I hope you don't mind.
width = the width of your screen in pixels
height = the height of your screen in pixels
CBitmap cbmp;
cbmp.LoadBitmap(IDB_BITMAP
HBITMAP Bmp;
Bmp=(HBITMAP)cbmp;
BITMAP bm;
GetObject(Bmp, sizeof(bm), &bm);
CPaintDC dc(this);
HDC memdc = CreateCompatibleDC(NULL);
HBITMAP h = (HBITMAP)SelectObject(memd
StrectchBlt(dc,0,0,bm.bmWi
SelectObject(memdc, h);
I don't have any intention to cross krips, just trying to help, krips I hope you don't mind.
Hi b_harpal,
In the OnPaint() function, I used the following
CPaintDC dc(this);
int width = 150;
int hieght = 150;
int width1 = 0;
int hieght1 = 0;
HDC hMemDC = ::CreateCompatibleDC(NULL) ;
SelectObject(hMemDC, hbitmap);
::StretchBlt(dc.m_hDC, 0, 0, width, hieght, hMemDC, width1, hieght1, 250,250, SRCCOPY);
::DeleteDC(hMemDC);
::DeleteObject(hbitmap);
If u want to increase the size, increase the values of width and hieght.
If u still have any problems,please be specific in ur problem(what error u r gettin?)and please do send queries if u have.
cheers.
In the OnPaint() function, I used the following
CPaintDC dc(this);
int width = 150;
int hieght = 150;
int width1 = 0;
int hieght1 = 0;
HDC hMemDC = ::CreateCompatibleDC(NULL)
SelectObject(hMemDC, hbitmap);
::StretchBlt(dc.m_hDC, 0, 0, width, hieght, hMemDC, width1, hieght1, 250,250, SRCCOPY);
::DeleteDC(hMemDC);
::DeleteObject(hbitmap);
If u want to increase the size, increase the values of width and hieght.
If u still have any problems,please be specific in ur problem(what error u r gettin?)and please do send queries if u have.
cheers.
ASKER
hi krisp,
ur simply expert..thanks.but i think u can help me much more.
iam making a HP-UX tutor as final year project.so please help me..i had to use animations,sounds..etc.it would be great help and kind of u if u could help me in some way..like providing me some links..hope u reply....if required u can mail me at bharpal@yahoo.com..once again thanks for ur support.
cheers
harpal
ur simply expert..thanks.but i think u can help me much more.
iam making a HP-UX tutor as final year project.so please help me..i had to use animations,sounds..etc.it would be great help and kind of u if u could help me in some way..like providing me some links..hope u reply....if required u can mail me at bharpal@yahoo.com..once again thanks for ur support.
cheers
harpal
ASKER
hi krisp,
this is my first time...i think there's some problem..it is showing 3 pts instead of 30..so please..check it out.
harpal
this is my first time...i think there's some problem..it is showing 3 pts instead of 30..so please..check it out.
harpal
#define IDC_TIMER 1000
define a message map
afx_msg void OnTimer(bla bla bla)
then make your function in OnTimer
In your main application use SetTimer(blablabla) <--- to set how long you want to wait before loading the next function.
More detailed explaination could be found in http://devcentral.iftech.com/Learning/tutorials/mfc-win32/vc6mfc/5.asp