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
|
0 Comments:
Post a Comment
<< Home