Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  Inserting 1 bitmap in to another (Thursday, January 06, 2005)




Found the following interesting discussion in the Newsgroups:

Inserting 1 bitmap in to another
by:Stu

Hi,

What is the quickest (performance wise) way to copy one small bitmap to
certain coordinates of a bigger bitmap? I'm currently doing it by looping
through each pixel....and I get the feeling I've missed something a little
more elegant!

Thanks in advance,

Stew



 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
\\Dim b1 As New Bitmap(...)
Dim b2 As New Bitmap(...)
Dim g As Graphics = Graphics.FromImage(b1)
g.DrawImage(b2, ...)
g.Dispose()
b1.Save(...)
b1.Dispose()
b2.Dispose()
///

--
Herfried K. Wagner [MVP]


 Reply:
by:Mick Doherty

 What's wrong with DrawImage?

\\\\\\\\\Function StampImage(ByVal Source As Image, ByVal Stamp As Image, Coord as
Point) As Image
Dim NewBmp As New Bitmap(Source)
Dim NewGraphics As Graphics = Graphics.FromImage(NewBmp)
NewGraphics.DrawImage(Stamp, Coord )
Return NewBmp
End Function
//////////

--
Mick Doherty
http://homepage.ntlworld.com/mdaudi100/index.html
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 31/05/2004


 Reply:
by:spamfurnace

 Watch yourself here, though. This knida stuff can become extremely amusing,
and many hours can be wasted tinkering the GDI+ namespace. It really needs
some kind of restricted access/parental gudiance/disclaimer thingy to be
smacked on the front of it.

Terribly addictive stuff that... so be warned.

Richard


 Reply:
by:Andre Nogueira

 And only now you tell me about it... after i've spent so many hours playing
around with it...
I feel betrayed.. :(

Andre Nogueira








 
Previous Posts
    - Use right-click to select a listbox item
    - Efficacy of User Interface Design
    - Reading RAW Disc Sectors
    - tom.ITextRange Find Reguler Expresssion does not w...
    - VB and unicode
    - Adapter Wizard Part 2
    - Reading the Flash File(.SWF) information
    - Passing value to windows form user control
    - Question on future compatibility between VB.NET an...
    - Retrieving files of filesystem

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland