CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2014
    Posts
    10

    bitBlt & scrolling issue

    Hi,

    and I have 0 , 0 instead of offsetx and offsety in the bitBlt, I get the following output;



    If I uncomment the selectObject and use offsetx and offsety in the bitBlt, I get the following output;



    The second image is of a bitmap that is being scrolled down.

    I return TRUE in EraseBckgrnd.

    How can I fix this? I literally have tried everything.

    If I use nPosX and nPosY, only one bitmap is rendered on the screen.

    All help is appreciated.
    Last edited by PREFETCH0; March 8th, 2021 at 05:20 PM.

  2. #2
    Join Date
    Mar 2021
    Posts
    1

    Re: bitBlt & scrolling issue

    1

    If the background is supposed to stay fixed while the text moves around on it, I would suggest that you maintain two separate bitmaps: one that contains the background image, and a second one that contains the text on a transparent background. Web Application Development Company

  3. #3
    Join Date
    Mar 2014
    Posts
    10

    Re: bitBlt & scrolling issue

    Quote Originally Posted by yashnit View Post
    1

    If the background is supposed to stay fixed while the text moves around on it, I would suggest that you maintain two separate bitmaps: one that contains the background image, and a second one that contains the text on a transparent background. Web Application Development Company
    What text? that is part of the bitmap.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: bitBlt & scrolling issue

    Quote Originally Posted by PREFETCH0 View Post
    Hi,
    ...
    If I comment out;

    Code:
    m_hBmpOld = (HBITMAP)SelectObject(dcBuffer, m_hBmpNew);
    and I have 0 , 0 instead of offsetx and offsety in the bitBlt, I get the following output;

    https://hostr.co/file/970/g60huNooRd...t7.56.10PM.png

    If I uncomment the selectObject and use offsetx and offsety in the bitBlt, I get the following output;

    https://hostr.co/file/970/jnKBVc0AJx...t7.58.06PM.png

    The second image is of a bitmap that is being scrolled down.

    I return TRUE in EraseBckgrnd.

    How can I fix this? I literally have tried everything.

    If I use nPosX and nPosY, only one bitmap is rendered on the screen.

    All help is appreciated.
    1. Could you explain what you are trying to achieve (in words, not just in code!) and what works not as expected?
    2. Please, attach your images to your post! See the Announcements, section "Information on posting:", subsection Attachments.
    Victor Nijegorodov

  5. #5
    Join Date
    Mar 2014
    Posts
    10

    Re: bitBlt & scrolling issue

    Well, what works is that the bitmap is displayed, but there is a scrolling issue as seen in picture.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: bitBlt & scrolling issue

    Quote Originally Posted by PREFETCH0 View Post
    Well, what works is that the bitmap is displayed, but there is a scrolling issue as seen in picture.
    Sorry, but I don't trust the sites where you uploaded your pictures.
    Victor Nijegorodov

  7. #7
    Join Date
    Mar 2014
    Posts
    10

    Re: bitBlt & scrolling issue

    Quote Originally Posted by VictorN View Post
    Sorry, but I don't trust the sites where you uploaded your pictures.
    Ok I’ll attach as images, but they were fairly large

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: bitBlt & scrolling issue

    Quote Originally Posted by PREFETCH0 View Post
    Ok I’ll attach as images, but they were fairly large
    Then scale them to the reasonable size! MS Paint can do it pretty good and fast!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured