Jump to content

ins0mniaque

Newbies
  • Posts

    2
  • Joined

  • Last visited

About ins0mniaque

  • Birthday 01/01/1970

Profile Information

  • Location
    Montréal, QC, Canada
  • Interests
    Typing less

ins0mniaque's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. OMG! That's what you get for jumping directly to code... But let's say I really really wanted to do this, is there a way you would suggest me to do it ? Is there a single-thread effect model ? Or do I have to execute this from my configuration window and read from it from the render thread ?
  2. Hi, first time on forum, - "Welcome to the forum", well thank you. Time for substance. I'm writing a test plugin that write the source surface to a bitmap on disk, waits for an executable to end and then re-reads the bitmap and render it on the destination surface. The problem is that after my render loop is called, a ProgressDialog apprears with "Rendering...", and it renders for ~15-20 seconds a 50x50px image. Here is my reduced code [no error checking, etc...] but tested that it still has this behavior. public override void Render ( EffectConfigToken parameters, RenderArgs destination, RenderArgs source, Rectangle [ ] rois, int startIndex, int length ) { // Validate configuration token MyEffectConfigToken Token = parameters as MyEffectConfigToken; // Retrieve selection PdnRegion SelectionRegion = EnvironmentParameters.GetSelection ( source.Bounds ); Rectangle SelectionBounds = SelectionRegion.GetBoundsInt ( ); // Create temporary filenames string InputFileName = Path.Combine ( Path.GetTempPath ( ), Path.ChangeExtension ( Path.GetRandomFileName ( ), ".bmp" ) ); string OutputFileName = Path.Combine ( Path.GetTempPath ( ), Path.ChangeExtension ( Path.GetRandomFileName ( ), ".bmp" ) ); // Create bitmap and save it to InputFileName Bitmap Bitmap = source.Surface.CreateAliasedBitmap ( SelectionBounds, true ); Bitmap.Save ( InputFileName, ImageFormat.Bmp ); // Create process Process Process = new Process ( ); Process.StartInfo.FileName = Path.Combine ( Path.GetDirectoryName ( Assembly.GetExecutingAssembly ( ).Location ), "MyExecutable.exe" ); Process.StartInfo.Arguments = string.Format ( "-input \"{0}\" -output \"{1}\" {2}", InputFileName, OutputFileName, Token.CommandLine ); Process.StartInfo.CreateNoWindow = true; Process.StartInfo.UseShellExecute = false; Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; // Start process Process.Start ( ); // Wait for process to end Process.WaitForExit ( ); // Read OutputFileName and draw bitmap using ( Bitmap OutputBitmap = new Bitmap ( OutputFileName ) ) destination.Graphics.DrawImageUnscaledAndClipped ( OutputBitmap, SelectionBounds ); } Any help would be greatly appreciated.
×
×
  • Create New...