473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Inserting 1 bitmap in to another

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

Nov 20 '05 #1
4 1100
* "Stu" <s.****@cergis.com> scripsit:
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!


\\\
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]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
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
"Stu" <s.****@cergis.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
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

---
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
Nov 20 '05 #3
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
Nov 20 '05 #4
And only now you tell me about it... after i've spent so many hours playing
around with it...
I feel betrayed.. :(

Andre Nogueira

"spamfurnace" <bi*******@tastycheeks.com> wrote in message
news:uE**************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sharon | last post by:
I have 2 questions that are just the opposite to one another: (1) I need to read an image file (like bitmap, jpeg etc.) and to save only its data, I need to save his data in a raw data format,...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
9
by: SStory | last post by:
I use a bitmap class new bitmap(filepath) this should and does load my jpg into memory. I then want to use mybitmap.save(filepath,imaging.imageformat.jpeg) to save it; overwriting the...
3
by: CSH | last post by:
Hi all, I've run into a small problem opening and saving bitmaps. Concider the following code: Dim oBM as Bitmap Dim cFileName as String ... some code to get the filename etc...
7
by: Dennis | last post by:
I am trying to implement drawing on a bitmap and using bitblt to transfer it to the control graphics object in the paint event. It seems to draw on the bitmap ok but doesn't get transferred to the...
7
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
1
by: farrukhqadri786 | last post by:
Hi! I have an imageList and a richtextbox in a C# form. I want to insert image from imageList into a richtextbox. I have found the following code on net but it does'nt work. ...
1
by: =?Utf-8?B?Y3JhbmtlX2JveQ==?= | last post by:
Hi Folks, I'm not sure where this post belongs since I'm using managed vc.net, but the issue is around GDI BitBlt. Here is a summary of the problem: - I am trying to copy a bitmap of my main...
1
by: Mike Fellows | last post by:
I have some images stored locally that i retrieve and insert into a word document that is programatically created im using the following code If File.Exists("C:\Pic2.jpg") Then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.