Jump to content

Thanh

Newbies
  • Posts

    6
  • Joined

  • Last visited

About Thanh

  • Birthday 01/01/1970

Thanh's Achievements

Rookie

Rookie (2/14)

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

Recent Badges

0

Reputation

  1. Oh, I see ... if the Paint.Net had more optional method, it would be more interesting. Anyway, thank you very much for your answering and supporting.
  2. 1) Oh! I know that the Render() method is called many times. But, I want to ask how I can set that this method will be called only one time. In other words, my plugin does something below: step 1: get parameters from dialog to render new image. step 2: rendering new image. step 3: calculating new image and writing the information to a file. step 4: evaluating the information if the information is good enough, go to stop rendering. else re-calculate new parameters and go to step 2 with new updated paremeters. Thus, in this case, I want that my Render() method will be called only one time. At the moment, it confused me a lot. Can I reset any value in order to archive my expectation? Thanks,
  3. Yes, I am working with Paint.Net v2.1b. Thanks for your response soon but I still have some concerns. 1. 'EffectDirectives' is not found in the v2.1, I think you guide me for v2.6. Coming back to v2.1, although I set ' this.singleThreaded = true; ' in the contructor method of base Effect class but it is not thread safe. Because, in the Render() method, there is only one feature to write 'test' message to file 'test.txt', but when I open this file, I see that there are 50 'test' strings. I expect to receice only one 'test' string in the file. How can I do? 2. Because I built my plugin with v2.1, could you guide me what should focus when it is moved into v2.63? Thank you!
  4. I have some questions. 1. How can I set that the SingleThreadedEffect attribute is applied? 2. Could I set that RenderArgs.Graphics or RenderArgs.Bitmap are thread-safe? 3. BTW, I have a problem when implement the my effect plugin. If I use ' foreach (Rectangle rect in roi.GetRegionScansReadOnlyInt()) ' , the result is fast. But, if I don't use it, I want to calculate whole of image, the speed is very slow. And, in some cases, the Render() does nothing, I think the problem may be about threading. 4. Could you explain how to use the threading method of Paint.Net effectively? Please help me to answer. Thanks in advanced.
  5. I am writting a new plug in for Paint.Net. I built new plugin like Rotate / Zoom plugin. I have a problem that I want to display some value after executing from Render() function, but I set value to the properties and I get no changed value. Example: I have a variable in MyPluginEffectConfigToken.cs ... private string resultPop; public string ResultPop { get { return resultPop; } set { this.resultPop = value; } } ... I set value for this variable in the Render() function in the MyPluginEffect.cs ... public unsafe void Render(EffectConfigToken properties, RenderArgs dstArgs, RenderArgs srcArgs, PdnRegion roi) { RetinexEffectConfigToken token = (RetinexEffectConfigToken)properties; token.ResultPop = "new"; ... } In the MyPluginEffectConfigDialog.cs, I set value for the variable of token in the InitialInitToken() Function ... protected override void InitialInitToken() { theEffectToken = new RetinexEffectConfigToken(); ((MyPluginEffectConfigToken)theEffectToken).ResultPop = "old"; } ... And, I have try many ways but, in the Dialog, I cannot get value of ((MyPluginEffectConfigToken)theEffectToken).ResultPop is "new" value. It always "old" value. Please help me to solve this problem. At the moment, I have a solution that the new value in the Render() function is written to a temp file. After that, in the dialog, the value will be gotten from that file. But, I think it is not good.
×
×
  • Create New...