Manual scroll rendering

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Workgroups

    #1

    Manual scroll rendering

    I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in size.
    I think this is too large of a size for a control or a form, so I think I
    need to "fake it" with a custom drawn control.

    I do not need to maintain a bitmap or make the control surface physically
    larger than the screen, becuase I can create the grid dynamically based upon
    any virtual X, Y upper-left coordinate of the currently viewed area. E.g.,
    if I am scrolled to X=82503 and Y=53301, I can pain what the grid would
    theoretically look like at this position, without having to actually
    maintain a grid that is actually that large.

    Because I won't be working with a control that is bigger than the
    screen/form, I have placed v&h scrollbar controls on my control, and
    OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
    loosely after observing autoscroll's invalidation behavior).

    But my problem with the painting is not the new, invalidated area; it's
    "shifting" the non-invalidated, already-drawn portion without having to
    repaint the whole thing from scratch. I don't know how to do this part - I
    think I want to perform a Transform? But it seems rather complex (I don't
    really understand the matrix object!)

    If I click my vertical scroll bar and the thumb moves 10 pixels "down", in
    response to this OnPaint I need to "shift" the currently painted scene up
    10px, thus exposing an "invalidate d" 10px area at the bottom. I can draw
    this new 10px portion just fine, but... how do I perform this "shift" of the
    previously painted area? When I used to rely on autoscroll to invalidate
    for me, I only had to worry about painting the newly invalidated area and
    the "shift" happened automatically (and smoothly) and now without the
    benefit of autoscroll I want to reproduce that manually.


  • Some Guy

    #2
    Re: Manual scroll rendering

    Try using ScrollWindow.

    Private Declare Function ScrollWindow Lib "user32.dll " (ByVal hWnd As Int32,
    ByVal XAmount As Int32, ByVal YAmount As Int32, ByRef lpRect As RECT, ByRef
    lpClipRect As RECT) As Int32


    "Workgroups " <noreply@domain less.com> wrote in message
    news:3sWdnQniE_ wKj2XfRVn-rw@speakeasy.ne t...[color=blue]
    >I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in size.
    >I think this is too large of a size for a control or a form, so I think I
    >need to "fake it" with a custom drawn control.
    >
    > I do not need to maintain a bitmap or make the control surface physically
    > larger than the screen, becuase I can create the grid dynamically based
    > upon any virtual X, Y upper-left coordinate of the currently viewed area.
    > E.g., if I am scrolled to X=82503 and Y=53301, I can pain what the grid
    > would theoretically look like at this position, without having to actually
    > maintain a grid that is actually that large.
    >
    > Because I won't be working with a control that is bigger than the
    > screen/form, I have placed v&h scrollbar controls on my control, and
    > OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
    > loosely after observing autoscroll's invalidation behavior).
    >
    > But my problem with the painting is not the new, invalidated area; it's
    > "shifting" the non-invalidated, already-drawn portion without having to
    > repaint the whole thing from scratch. I don't know how to do this part -
    > I think I want to perform a Transform? But it seems rather complex (I
    > don't really understand the matrix object!)
    >
    > If I click my vertical scroll bar and the thumb moves 10 pixels "down", in
    > response to this OnPaint I need to "shift" the currently painted scene up
    > 10px, thus exposing an "invalidate d" 10px area at the bottom. I can draw
    > this new 10px portion just fine, but... how do I perform this "shift" of
    > the previously painted area? When I used to rely on autoscroll to
    > invalidate for me, I only had to worry about painting the newly
    > invalidated area and the "shift" happened automatically (and smoothly) and
    > now without the benefit of autoscroll I want to reproduce that manually.
    >[/color]


    Comment

    • Workgroups

      #3
      Re: Manual scroll rendering

      Yes that does the trick. Thanks for your help.

      "Some Guy" <noplace@nowher e.com> wrote in message
      news:%23k$lZoIn FHA.1416@TK2MSF TNGP09.phx.gbl. ..[color=blue]
      > Try using ScrollWindow.
      >
      > Private Declare Function ScrollWindow Lib "user32.dll " (ByVal hWnd As
      > Int32, ByVal XAmount As Int32, ByVal YAmount As Int32, ByRef lpRect As
      > RECT, ByRef lpClipRect As RECT) As Int32
      >
      >
      > "Workgroups " <noreply@domain less.com> wrote in message
      > news:3sWdnQniE_ wKj2XfRVn-rw@speakeasy.ne t...[color=green]
      >>I need to scroll a virtual grid that is 1.2M pixels x 1.28M pixels in
      >>size. I think this is too large of a size for a control or a form, so I
      >>think I need to "fake it" with a custom drawn control.
      >>
      >> I do not need to maintain a bitmap or make the control surface physically
      >> larger than the screen, becuase I can create the grid dynamically based
      >> upon any virtual X, Y upper-left coordinate of the currently viewed area.
      >> E.g., if I am scrolled to X=82503 and Y=53301, I can pain what the grid
      >> would theoretically look like at this position, without having to
      >> actually maintain a grid that is actually that large.
      >>
      >> Because I won't be working with a control that is bigger than the
      >> screen/form, I have placed v&h scrollbar controls on my control, and
      >> OnScroll I invalidate the newly scrolled area to trigger OnPaint (modeled
      >> loosely after observing autoscroll's invalidation behavior).
      >>
      >> But my problem with the painting is not the new, invalidated area; it's
      >> "shifting" the non-invalidated, already-drawn portion without having to
      >> repaint the whole thing from scratch. I don't know how to do this part -
      >> I think I want to perform a Transform? But it seems rather complex (I
      >> don't really understand the matrix object!)
      >>
      >> If I click my vertical scroll bar and the thumb moves 10 pixels "down",
      >> in response to this OnPaint I need to "shift" the currently painted scene
      >> up 10px, thus exposing an "invalidate d" 10px area at the bottom. I can
      >> draw this new 10px portion just fine, but... how do I perform this
      >> "shift" of the previously painted area? When I used to rely on
      >> autoscroll to invalidate for me, I only had to worry about painting the
      >> newly invalidated area and the "shift" happened automatically (and
      >> smoothly) and now without the benefit of autoscroll I want to reproduce
      >> that manually.
      >>[/color]
      >
      >[/color]


      Comment

      Working...