Autor Beitrag
Max064
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Mo 06.09.10 08:21 
Hi,

ich versuche 2 Bitmaps in eine dritte Einzufügen. Leider komme ich hier an die Grenzen der Laufzeiten. Ich glaube es sehr umständlich zu machen. Wie kann ich es verbessern?

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
// Bitmap1
Graphics g = axShockwaveFlash1.CreateGraphics();
Bitmap bmp = new Bitmap(axShockwaveFlash1.Size.Width, axShockwaveFlash1.Size.Height, g);
Graphics memoryGraphics = Graphics.FromImage(bmp);
IntPtr dc = memoryGraphics.GetHdc();
bool success = PrintWindow(axShockwaveFlash1.Handle, dc, 0);
memoryGraphics.ReleaseHdc(dc);

//Bitmap2
Graphics g2 = axShockwaveFlash1.CreateGraphics();
Bitmap bmp2 = new Bitmap(axShockwaveFlash2.Size.Width, axShockwaveFlash2.Size.Height, g2);
Graphics memoryGraphics2 = Graphics.FromImage(bmp2);
dc = memoryGraphics.GetHdc();
success = PrintWindow(axShockwaveFlash2.Handle, dc, 0);
memoryGraphics2.ReleaseHdc(dc);

//zusammenfügen+ Bitmap 3
Bitmap bitmap = new Bitmap(rect.Width, rect.Height);
this.panel1.DrawToBitmap(bitmap, rect);
Graphics final = Graphics.FromImage(bitmap);
final.DrawImage(bmp, new Rectangle(axShockwaveFlash1.Location, axShockwaveFlash1.Size));
final.DrawImage(bmp2, new Rectangle(axShockwaveFlash2.Location, axShockwaveFlash2.Size));
return bitmap;


lg Max