concat two bitmaps?

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

    concat two bitmaps?

    is there anyway to connect to bitmaps together?
    basically, I have a program that generates a graph as it runs, and I can
    capture an image of the graph, but is there a way to take two captures, and
    join them together so it looks like one big graph?


  • Chris Capel

    #2
    Re: concat two bitmaps?

    Well, what you would do is create a new image with dimensions big enough to
    fit both of the smaller ones, create a Graphics objects from the destination
    image, and then use the source objects to draw the source images on the
    graphics from the destination image in the desired spots. Of course, all
    this accomplishes is setting the two images next to each other; anything
    requiring an actual change to the source images would be infinitely more
    complicated to implement. Any questions?

    Chris

    "Phil" <webmaster@visu alcoders.net> wrote in message
    news:OPEJKXLYDH A.2352@TK2MSFTN GP12.phx.gbl...[color=blue]
    > is there anyway to connect to bitmaps together?
    > basically, I have a program that generates a graph as it runs, and I can
    > capture an image of the graph, but is there a way to take two captures,[/color]
    and[color=blue]
    > join them together so it looks like one big graph?
    >
    >[/color]


    Comment

    • Michael Mayer

      #3
      Re: concat two bitmaps?

      I just noticed Christopher replied. But here's some code that should
      do the trick:
      (note, there's a lot of scaling, rotating, etc. you can do in the
      gr.DrawImage).
      Bitmap bmp1 = new Bitmap(@"C:\win dows\Coffee Bean.bmp");
      Bitmap bmp2 = new Bitmap(@"C:\win dows\Soap Bubbles.bmp");
      int width = bmp1.Width + bmp2.Width;
      int height = Math.Max(bmp1.H eight, bmp2.Height);
      Bitmap fullBmp = new Bitmap(width, height);
      Graphics gr = Graphics.FromIm age(fullBmp);
      gr.DrawImage (bmp1, 0, 0, bmp1.Width, bmp1.Height);
      gr.DrawImage (bmp2, bmp1.Width, 0);
      fullBmp.Save( blah );




      "Phil" <webmaster@visu alcoders.net> wrote in message
      news:OPEJKXLYDH A.2352@TK2MSFTN GP12.phx.gbl...[color=blue]
      > is there anyway to connect to bitmaps together?
      > basically, I have a program that generates a graph as it runs, and I[/color]
      can[color=blue]
      > capture an image of the graph, but is there a way to take two[/color]
      captures, and[color=blue]
      > join them together so it looks like one big graph?
      >
      >[/color]



      Comment

      Working...