Advertisement Jump to content
Sign in to follow this  

Flash BitBlt success but fps help?

This topic is 4921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a success with showing flash on a texture. But there's one little problem: I need to create the bitmap each time in the captureframe function. This takes 15 ms. This is a lot for fps because the flash file could be at 1280x1024 on a top system.
		public void Navigate(string url)
			while (!ibrowser.Created)

			object arg1 = 0;
			object arg2 = "";
			object arg3 = "";
			object arg4 = "";

			ibrowser.Navigate(url, ref arg1, ref arg2, ref arg3, ref arg4);
			ibrowser.Width = width;
			ibrowser.Height = height;

			//bmp = new Bitmap(width,height);

			while (!documentComplete)

			while (GetHtmlBody() == null)



		private Bitmap bmp = new Bitmap(w,h); 

		private const int w = 1280;
		private const int h = 1024;

		private int width = w;
		private int height = h;
		Rectangle Rect = new Rectangle(0,0, w, h); 

		public Bitmap CaptureFrame()
			bmp = new Bitmap(w,h); // This line must be applied each time but is not fast because it takes 15 ms
			while ((GetHtmlBody()) == null)

			//lock (bmp)
				IntPtr memDC = Win32.CreateCompatibleDC(IntPtr.Zero);
				Graphics g = Graphics.FromImage(bmp);
				IntPtr bitmapHDC = g.GetHdc();

				IntPtr memBmp = Win32.CreateCompatibleBitmap(bitmapHDC, width, height);
				IntPtr oldBmp = Win32.SelectObject(memDC, memBmp);

				Win32.OleDraw(this.ibrowser.GetOcx(), 1, memDC, ref Rect);

				Win32.BitBlt(bitmapHDC, 0,0, width, height, memDC, 0,0, TernaryRasterOperations.SRCCOPY);
				Win32.SelectObject(memDC, oldBmp);
			return bmp;
[Edited by - Coder on August 3, 2005 6:21:15 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!