Using bitmaps

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

    #1

    Using bitmaps

    Hello,

    I'm needing some advice: I have an app for which I've built a timer out of
    multiple bitmaps--a clock with a moving hands. I've saved each hand
    position (1 second, 2 seconds, etc.) as a separate bitmap, and I make the
    clock "tic" down by changing the image of a picture box. The problem, of
    course, is that the application uses tons of memory, because each of the
    bitmaps is preloaded into an array. Is there an easier way to do this, or a
    way to cut down on memory usage?

    Thanks in advance,
    Nathan


  • SStory

    #2
    Re: Using bitmaps

    Why not rotate one image around the center?

    Is this image something special--more than just drawing lines for the
    hands?? If not drawing lines would be the best.. To see how, Microsoft does
    have a clock demo for VB.NET that is super and shows the trig needed for
    calculating the coords for the line as it moves around....

    HTH

    Shane

    "Nathan" <nkmacgregor.Ta keThisOut@softh ome.net> wrote in message
    news:%23JlhnQad EHA.1152@TK2MSF TNGP09.phx.gbl. ..[color=blue]
    > Hello,
    >
    > I'm needing some advice: I have an app for which I've built a timer out[/color]
    of[color=blue]
    > multiple bitmaps--a clock with a moving hands. I've saved each hand
    > position (1 second, 2 seconds, etc.) as a separate bitmap, and I make the
    > clock "tic" down by changing the image of a picture box. The problem, of
    > course, is that the application uses tons of memory, because each of the
    > bitmaps is preloaded into an array. Is there an easier way to do this, or[/color]
    a[color=blue]
    > way to cut down on memory usage?
    >
    > Thanks in advance,
    > Nathan
    >
    >[/color]


    Comment

    • SStory

      #3
      Re: Using bitmaps

      One more thought....
      how big are the bitmaps?
      How big do you plan on showing your clock.

      Be sure that your bitmap is no larger than you will ever need.
      for example don't load an 800x600 picture into the bitmap and use drawimage
      to draw it scaled down...
      just make the original as small as possible and load it.

      For a small clock I can't see it taking much memory for some hands at all
      positions anyway... but seems rotation would be a better mehod.

      My 2 cents worth..

      Shane
      "Nathan" <nkmacgregor.Ta keThisOut@softh ome.net> wrote in message
      news:%23JlhnQad EHA.1152@TK2MSF TNGP09.phx.gbl. ..[color=blue]
      > Hello,
      >
      > I'm needing some advice: I have an app for which I've built a timer out[/color]
      of[color=blue]
      > multiple bitmaps--a clock with a moving hands. I've saved each hand
      > position (1 second, 2 seconds, etc.) as a separate bitmap, and I make the
      > clock "tic" down by changing the image of a picture box. The problem, of
      > course, is that the application uses tons of memory, because each of the
      > bitmaps is preloaded into an array. Is there an easier way to do this, or[/color]
      a[color=blue]
      > way to cut down on memory usage?
      >
      > Thanks in advance,
      > Nathan
      >
      >[/color]


      Comment

      • Nathan

        #4
        Re: Using bitmaps

        Thanks for your two cents. No, I'm not using bigger bmps than I need, and
        I've given a thought to drawing lines -- I'm just better at drawing with
        Adobe Illustrator than I am with VB code. I'll look for the clock demo.


        "SStory" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
        news:%23VQa3Ydd EHA.320@TK2MSFT NGP10.phx.gbl.. .[color=blue]
        > One more thought....
        > how big are the bitmaps?
        > How big do you plan on showing your clock.
        >
        > Be sure that your bitmap is no larger than you will ever need.
        > for example don't load an 800x600 picture into the bitmap and use[/color]
        drawimage[color=blue]
        > to draw it scaled down...
        > just make the original as small as possible and load it.
        >
        > For a small clock I can't see it taking much memory for some hands at all
        > positions anyway... but seems rotation would be a better mehod.
        >
        > My 2 cents worth..
        >
        > Shane
        > "Nathan" <nkmacgregor.Ta keThisOut@softh ome.net> wrote in message
        > news:%23JlhnQad EHA.1152@TK2MSF TNGP09.phx.gbl. ..[color=green]
        > > Hello,
        > >
        > > I'm needing some advice: I have an app for which I've built a timer out[/color]
        > of[color=green]
        > > multiple bitmaps--a clock with a moving hands. I've saved each hand
        > > position (1 second, 2 seconds, etc.) as a separate bitmap, and I make[/color][/color]
        the[color=blue][color=green]
        > > clock "tic" down by changing the image of a picture box. The problem,[/color][/color]
        of[color=blue][color=green]
        > > course, is that the application uses tons of memory, because each of the
        > > bitmaps is preloaded into an array. Is there an easier way to do this,[/color][/color]
        or[color=blue]
        > a[color=green]
        > > way to cut down on memory usage?
        > >
        > > Thanks in advance,
        > > Nathan
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Nathan

          #5
          Re: Using bitmaps

          Thanks for your two cents. No, I'm not using bigger bmps than I need, and
          I've given a thought to drawing lines -- I'm just better at drawing with
          Adobe Illustrator than I am with VB code. I'll look for the clock demo.


          "SStory" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> wrote in message
          news:%23VQa3Ydd EHA.320@TK2MSFT NGP10.phx.gbl.. .[color=blue]
          > One more thought....
          > how big are the bitmaps?
          > How big do you plan on showing your clock.
          >
          > Be sure that your bitmap is no larger than you will ever need.
          > for example don't load an 800x600 picture into the bitmap and use[/color]
          drawimage[color=blue]
          > to draw it scaled down...
          > just make the original as small as possible and load it.
          >
          > For a small clock I can't see it taking much memory for some hands at all
          > positions anyway... but seems rotation would be a better mehod.
          >
          > My 2 cents worth..
          >
          > Shane
          > "Nathan" <nkmacgregor.Ta keThisOut@softh ome.net> wrote in message
          > news:%23JlhnQad EHA.1152@TK2MSF TNGP09.phx.gbl. ..[color=green]
          > > Hello,
          > >
          > > I'm needing some advice: I have an app for which I've built a timer out[/color]
          > of[color=green]
          > > multiple bitmaps--a clock with a moving hands. I've saved each hand
          > > position (1 second, 2 seconds, etc.) as a separate bitmap, and I make[/color][/color]
          the[color=blue][color=green]
          > > clock "tic" down by changing the image of a picture box. The problem,[/color][/color]
          of[color=blue][color=green]
          > > course, is that the application uses tons of memory, because each of the
          > > bitmaps is preloaded into an array. Is there an easier way to do this,[/color][/color]
          or[color=blue]
          > a[color=green]
          > > way to cut down on memory usage?
          > >
          > > Thanks in advance,
          > > Nathan
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...