|
From: Conan on 2 Sep 2005 05:18 Hi,Vipin: The m_bmpSample have loaded form the source. BOOL bLoad = m_bmpSample.LoadBitmap(IDB_SAMPLE_BMP); ASSERT(m_bmpSample.GetSafeHandle() != NULL); In the application,the m_bmpSample have showed normally,this whether signify its success for load ? -- Conan Wu Email:aqua_aqua(a)21cn.com "Vipin" wrote: > It can't be wrong. Your bitmap is not probably selected then into the > memory DC then, > leaving in it still the default 1X1 bitmap. check the return code of > SelectObject(...). It should be NULL most probably in your case. You may be > trying to select a non compatible DDB into a memory DC. > > You haven't shown any of your bitmap creation code, wherre is it? > > Thanks > Vipin > > "Conan" <Conan(a)discussions.microsoft.com> wrote in message > news:D4071DD6-A478-4087-BB46-9253696CE48C(a)microsoft.com... > > Oh,This I knew. > > But the SURFOBJ's sizlBitmap of the source surface is also (1,1), and the > > value is wrong. > > From the above code,This value(sizlBitmap of the SURFOBJ) is (200,306) is > > right, and should not be (1,1). > > -- > > Conan Wu > > Email:aqua_aqua(a)21cn.com > > > > > > > > "Vipin" wrote: > > > >> SURFOBJ's SIZEL sizlBitmap; has what you need. > >> > >> > >> Thanks > >> Vipin > >> > >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message > >> news:2365A89E-3A63-4DD5-8537-70AABE822BA0(a)microsoft.com... > >> > Hi Vipin; > >> > > >> > The size of m_bmpSample is (200,306). > >> > I hope to get the size of source surface in DrvCopyBits of driver.For > >> > instance, in above example code my hope is in DrvCopyBits get ( > >> > 200,306) > >> > this > >> > size . > >> > Now ,I don't know how to get the size of source and target in > >> > DrvCopyBits.This is the key point of this problem. > >> > > >> > Thanks > >> > -- > >> > Conan Wu > >> > Email:aqua_aqua(a)21cn.com > >> > MSN:aqua_aqua(a)21cn.com > >> > > >> > > >> > "Vipin" wrote: > >> > > >> >> (200,306) are the source/destination widths in BitBlt. That in itself > >> >> doesn't imply the bitmap widths. > >> >> What is the size of m_bmpSample? Use GetObject(...) and find out if > >> >> your > >> >> module is not the one that is creating the bitmap. > >> >> > >> >> Thanks > >> >> Vipin > >> >> > >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message > >> >> news:B728A8F8-3E6F-4E25-A37F-B31E6B796CFA(a)microsoft.com... > >> >> > Hi,Tim. > >> >> > Thanks for your reply. > >> >> > These codes are in the application: > >> >> > > >> >> > CDC dcmem; > >> >> > dcmem.CreateCompatibleDC(pDC); > >> >> > CBitmap* pOld = dcmem.SelectObject(&m_bmpSample); > >> >> > //m_bmpSample > >> >> > loaded a bitmap from the source. > >> >> > > >> >> > pDC->BitBlt(400,0,200,306,&dcmem,0,0,SRCCOPY); > >> >> > dcmem.DeleteDC(); > >> >> > > >> >> > From codes, you may find out. > >> >> > I have selected the bitmap into the dcmem,and the size of the bitmap > >> >> > is > >> >> > (200,306). > >> >> > > >> >> > > >> >> > > >> >> > "Tim Roberts" wrote: > >> >> > > > >> >> > > Is it possible that dcmem contains a 1x1 bitmap? Have you > >> >> > > actually > >> >> > > selected a memory bitmap into dcmem? How did you do it? > >> >> > > -- > >> >> > > - Tim Roberts, timr(a)probo.com > >> >> > > Providenza & Boekelheide, Inc. > >> >> > > > >> >> > >> >> > >> >> > >> > >> > >> > > >
From: Vipin on 2 Sep 2005 05:51 That is the problem. You are trying to select a incompatible DDB into a printer device context which is not compatible to hold the DDB you have created. I am quite sure your SelectObject(...) would have failed. From msdn:- " LoadBitmap creates a compatible bitmap of the display, which cannot be selected to a printer. To load a bitmap that you can select to a printer, call LoadImage and specify LR_CREATEDIBSECTION to create a DIB section. A DIB section can be selected to any device." "Conan" <Conan(a)discussions.microsoft.com> wrote in message news:E44B7D0D-CD8B-4F0F-A7AD-F45F18BBFAA3(a)microsoft.com... > Hi,Vipin: > > The m_bmpSample have loaded form the source. > > BOOL bLoad = m_bmpSample.LoadBitmap(IDB_SAMPLE_BMP); > ASSERT(m_bmpSample.GetSafeHandle() != NULL); > > In the application,the m_bmpSample have showed normally,this whether > signify > its success for load ? > > > -- > Conan Wu > Email:aqua_aqua(a)21cn.com > > > > "Vipin" wrote: > >> It can't be wrong. Your bitmap is not probably selected then into the >> memory DC then, >> leaving in it still the default 1X1 bitmap. check the return code of >> SelectObject(...). It should be NULL most probably in your case. You may >> be >> trying to select a non compatible DDB into a memory DC. >> >> You haven't shown any of your bitmap creation code, wherre is it? >> >> Thanks >> Vipin >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message >> news:D4071DD6-A478-4087-BB46-9253696CE48C(a)microsoft.com... >> > Oh,This I knew. >> > But the SURFOBJ's sizlBitmap of the source surface is also (1,1), and >> > the >> > value is wrong. >> > From the above code,This value(sizlBitmap of the SURFOBJ) is (200,306) >> > is >> > right, and should not be (1,1). >> > -- >> > Conan Wu >> > Email:aqua_aqua(a)21cn.com >> > >> > >> > >> > "Vipin" wrote: >> > >> >> SURFOBJ's SIZEL sizlBitmap; has what you need. >> >> >> >> >> >> Thanks >> >> Vipin >> >> >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message >> >> news:2365A89E-3A63-4DD5-8537-70AABE822BA0(a)microsoft.com... >> >> > Hi Vipin; >> >> > >> >> > The size of m_bmpSample is (200,306). >> >> > I hope to get the size of source surface in DrvCopyBits of >> >> > driver.For >> >> > instance, in above example code my hope is in DrvCopyBits get ( >> >> > 200,306) >> >> > this >> >> > size . >> >> > Now ,I don't know how to get the size of source and target in >> >> > DrvCopyBits.This is the key point of this problem. >> >> > >> >> > Thanks >> >> > -- >> >> > Conan Wu >> >> > Email:aqua_aqua(a)21cn.com >> >> > MSN:aqua_aqua(a)21cn.com >> >> > >> >> > >> >> > "Vipin" wrote: >> >> > >> >> >> (200,306) are the source/destination widths in BitBlt. That in >> >> >> itself >> >> >> doesn't imply the bitmap widths. >> >> >> What is the size of m_bmpSample? Use GetObject(...) and find out >> >> >> if >> >> >> your >> >> >> module is not the one that is creating the bitmap. >> >> >> >> >> >> Thanks >> >> >> Vipin >> >> >> >> >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message >> >> >> news:B728A8F8-3E6F-4E25-A37F-B31E6B796CFA(a)microsoft.com... >> >> >> > Hi,Tim. >> >> >> > Thanks for your reply. >> >> >> > These codes are in the application: >> >> >> > >> >> >> > CDC dcmem; >> >> >> > dcmem.CreateCompatibleDC(pDC); >> >> >> > CBitmap* pOld = dcmem.SelectObject(&m_bmpSample); >> >> >> > //m_bmpSample >> >> >> > loaded a bitmap from the source. >> >> >> > >> >> >> > pDC->BitBlt(400,0,200,306,&dcmem,0,0,SRCCOPY); >> >> >> > dcmem.DeleteDC(); >> >> >> > >> >> >> > From codes, you may find out. >> >> >> > I have selected the bitmap into the dcmem,and the size of the >> >> >> > bitmap >> >> >> > is >> >> >> > (200,306). >> >> >> > >> >> >> > >> >> >> > >> >> >> > "Tim Roberts" wrote: >> >> >> > > >> >> >> > > Is it possible that dcmem contains a 1x1 bitmap? Have you >> >> >> > > actually >> >> >> > > selected a memory bitmap into dcmem? How did you do it? >> >> >> > > -- >> >> >> > > - Tim Roberts, timr(a)probo.com >> >> >> > > Providenza & Boekelheide, Inc. >> >> >> > > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
From: Conan on 2 Sep 2005 23:34 Hi,Vipin: The problem have been solved. You are right.The error happens on LoadBitmap.Now,I use LoadImage to load bitmap,the virtual print can print it,everything is OK. The key of this problem as you claim. "LoadBitmap creates a compatible bitmap of the display, which cannot be selected to a printer. Call LoadImage and specify LR_CREATEDIBSECTION to create a DIB section. A DIB section can be selected to any device. " Wholehearted thanks for your warmheartedly. -- Conan Wu Email:aqua_aqua(a)21cn.com "Vipin" wrote: > That is the problem. You are trying to select a incompatible DDB into a > printer device context which is not compatible to hold the DDB you have > created. I am quite sure your SelectObject(...) would have failed. > > From msdn:- > " > LoadBitmap creates a compatible bitmap of the display, which cannot be > selected to a printer. To load a bitmap that you can select to a printer, > call LoadImage and specify LR_CREATEDIBSECTION to create a DIB section. A > DIB section can be selected to any device." > > > > > > > > > "Conan" <Conan(a)discussions.microsoft.com> wrote in message > news:E44B7D0D-CD8B-4F0F-A7AD-F45F18BBFAA3(a)microsoft.com... > > Hi,Vipin: > > > > The m_bmpSample have loaded form the source. > > > > BOOL bLoad = m_bmpSample.LoadBitmap(IDB_SAMPLE_BMP); > > ASSERT(m_bmpSample.GetSafeHandle() != NULL); > > > > In the application,the m_bmpSample have showed normally,this whether > > signify > > its success for load ? > > > > > > -- > > Conan Wu > > Email:aqua_aqua(a)21cn.com > > > > > > > > "Vipin" wrote: > > > >> It can't be wrong. Your bitmap is not probably selected then into the > >> memory DC then, > >> leaving in it still the default 1X1 bitmap. check the return code of > >> SelectObject(...). It should be NULL most probably in your case. You may > >> be > >> trying to select a non compatible DDB into a memory DC. > >> > >> You haven't shown any of your bitmap creation code, wherre is it? > >> > >> Thanks > >> Vipin > >> > >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message > >> news:D4071DD6-A478-4087-BB46-9253696CE48C(a)microsoft.com... > >> > Oh,This I knew. > >> > But the SURFOBJ's sizlBitmap of the source surface is also (1,1), and > >> > the > >> > value is wrong. > >> > From the above code,This value(sizlBitmap of the SURFOBJ) is (200,306) > >> > is > >> > right, and should not be (1,1). > >> > -- > >> > Conan Wu > >> > Email:aqua_aqua(a)21cn.com > >> > > >> > > >> > > >> > "Vipin" wrote: > >> > > >> >> SURFOBJ's SIZEL sizlBitmap; has what you need. > >> >> > >> >> > >> >> Thanks > >> >> Vipin > >> >> > >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message > >> >> news:2365A89E-3A63-4DD5-8537-70AABE822BA0(a)microsoft.com... > >> >> > Hi Vipin; > >> >> > > >> >> > The size of m_bmpSample is (200,306). > >> >> > I hope to get the size of source surface in DrvCopyBits of > >> >> > driver.For > >> >> > instance, in above example code my hope is in DrvCopyBits get ( > >> >> > 200,306) > >> >> > this > >> >> > size . > >> >> > Now ,I don't know how to get the size of source and target in > >> >> > DrvCopyBits.This is the key point of this problem. > >> >> > > >> >> > Thanks > >> >> > -- > >> >> > Conan Wu > >> >> > Email:aqua_aqua(a)21cn.com > >> >> > MSN:aqua_aqua(a)21cn.com > >> >> > > >> >> > > >> >> > "Vipin" wrote: > >> >> > > >> >> >> (200,306) are the source/destination widths in BitBlt. That in > >> >> >> itself > >> >> >> doesn't imply the bitmap widths. > >> >> >> What is the size of m_bmpSample? Use GetObject(...) and find out > >> >> >> if > >> >> >> your > >> >> >> module is not the one that is creating the bitmap. > >> >> >> > >> >> >> Thanks > >> >> >> Vipin > >> >> >> > >> >> >> "Conan" <Conan(a)discussions.microsoft.com> wrote in message > >> >> >> news:B728A8F8-3E6F-4E25-A37F-B31E6B796CFA(a)microsoft.com... > >> >> >> > Hi,Tim. > >> >> >> > Thanks for your reply. > >> >> >> > These codes are in the application: > >> >> >> > > >> >> >> > CDC dcmem; > >> >> >> > dcmem.CreateCompatibleDC(pDC); > >> >> >> > CBitmap* pOld = dcmem.SelectObject(&m_bmpSample); > >> >> >> > //m_bmpSample > >> >> >> > loaded a bitmap from the source. > >> >> >> > > >> >> >> > pDC->BitBlt(400,0,200,306,&dcmem,0,0,SRCCOPY); > >> >> >> > dcmem.DeleteDC(); > >> >> >> > > >> >> >> > From codes, you may find out. > >> >> >> > I have selected the bitmap into the dcmem,and the size of the > >> >> >> > bitmap > >> >> >> > is > >> >> >> > (200,306). > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > "Tim Roberts" wrote: > >> >> >> > > > >> >> >> > > Is it possible that dcmem contains a 1x1 bitmap? Have you > >> >> >> > > actually > >> >> >> > > selected a memory bitmap into dcmem? How did you do it? > >> >> >> > > -- > >> >> >> > > - Tim Roberts, timr(a)probo.com > >> >> >> > > Providenza & Boekelheide, Inc. > >> >> >> > > > >> >> >> > >> >> >> > >> >> >> > >> >> > >> >> > >> >> > >> > >> > >> > > >
First
|
Prev
|
Pages: 1 2 3 Prev: MPIO driver installation Next: HID and DirectInput ? (WDM Driver hidgame) |