win32 in memory

G

Guest

Does anyone have a sample code for this? I want to draw an image in memory
into another image using C# and win32 gdi.. if its confusing i'll rephrase
it. I want to draw many images into one image in memory using win32 gdi
(sample using bitblt or any suggested win32 that works the fastest) since the
..NET gdi is very slow in drawing graphics in my own opinion. I would really
appreciate any help. please any smaple code at all would be very much
approciated. Thank You so much in advace.

Stan
 
P

Patrice

Googling for dllImport BitBlt will return pages such as
http://www.codeproject.com/csharp/cscapturescreen1.asp. It should be fairly
easy to start from this...

If not done, I would also post about the first point in case someone would
find something particular in the code that doesn't perform well (stretching
with quality favored over performance ?)...
 
G

Guest

HI Patrice thanks for the link but i already saw this earlier (been googling
too) but it wasnt of any help of what i wanted to do. I wouldnt be asking in
this forum without having to go through a research first.. hehe Thanks
anyway.

What i was looking for was a win32 gdi version of this code:

Bitmap bmp = new Bitmap(100,100);

using(Graphics g = Graphics.FromImage(bmp))
{
g.Clear(Color.Black);
g.DrawLine(Pens.Red,0,0,99,99);
g.DrawLine(Pens.Blue, 0,99,99,0);
g.DrawImage(@"C:\pic1.jpg", 0, 0, 100, 200); // adds an image to the bmp image
g.Save();
}
......
return the bmp to the screen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top