CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Location
    Tallahassee, FL
    Posts
    121

    Bitmap / Image Concat'ing

    Could someone tell me how, using the Bitmap or Image classes, I can take a bitmap and append on to the end of another bitmap. Also, the bitmap's will have the same width. I just need to append another image to the end of the previous one in memory. I noticed there is an Image.FromStream function but I'm still lost as to how to append it onto another image...

    Thanks,
    - J

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890

    Thumbs up

    [FONT=arial][SIZE=3]
    2 Ways
    [SIZE=1]

    Method 1:

    Create a new bitmap and copy from 2 bitmap pixel wise pixel.
    (make sure you check for processing speed)

    Method 2 :
    render the two bitmap halves onto another bitmap

    for example,
    Bitmap dstBitmap = new Bitmap(width, height);
    using(Graphics g = Graphics.FromImage(dstBitmap))
    {
    g.DrawImage(srcBitmap1,dstX1,dstY1,scrRect1,GraphicsUnit.Pixel);
    g.DrawImage(srcBitmap2,dstX2,dstY2,scrRect2,GraphicsUnit.Pixel);
    }

    IMO this should work more elegant


    let me know if this works for you


    Paresh

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