By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,572 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,572 IT Pros & Developers. It's quick & easy.

create looping domain with performclick and timer

P: 1
I wanted to create a looping domain in VB that will automatically find the word "next" in a presentation, click it using possibly performclick or other action, and take a screen capture and save it to file. Below is the screen capture part of the code, I wanted to know how to expand it:

Expand|Select|Wrap|Line Numbers
  1.  RenderTargetBitmap rendertarget = new RenderTargetBitmap((int)element.RenderSize.Width,
  2.                         (int)element.RenderSize.Height, dpix, dpiy, PixelFormats.Default);
  3.             // Render the element on screen.
  4.             rendertarget.Render(element);
  5.  
  6.             BitmapEncoder bmpe;
  7.  
  8.             // Select the image format.
  9.             switch (format)
  10.             {
  11.                 case ImageFormats.PNG:
  12.                     {
  13.                         bmpe = new PngBitmapEncoder();
  14.                         break;
  15.                     }
  16.                 case ImageFormats.BMP:
  17.                     {
  18.                         bmpe = new BmpBitmapEncoder();
  19.                         break;
  20.                     }
  21.                 case ImageFormats.JPG:
  22.                     {
  23.                         bmpe = new JpegBitmapEncoder();
  24.                         break;
  25.                     }
  26.                 default:
  27.                     {
  28.                         bmpe = new PngBitmapEncoder();
  29.                         break;
  30.                     }
  31.             }
  32.  
  33.             bmpe.Frames.Add(BitmapFrame.Create(rendertarget));
  34.  
  35.             // Create a MemoryStream with the image.
  36.             // Returning this as a MemoryStream makes it easier to save the image to a file or simply display it anywhere.
  37.             Stream fl = new MemoryStream();
  38.             bmpe.Save(fl);
  39.  
  40.             fl.Close();
  41.  
  42.             return fl;
  43.         }
Mar 26 '13 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,382
Is this VB6 or VB.Net?
Apr 4 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.