The System.Process() method can take a path to the file you want to open. As long as a program is registered with the PDF file type, it will work. Alternatively, if you know where a specific PDF reader resides, you will have to invoke the EXE and pass the PDF path as a parameter.
If you know for sure that the user has Adobe Reader installed on his/her PC you can start that process with a parameter representing the path to your help file. This is the easiest solution, but not the most elegant.
This is James. I have been following this site from last few weeks now thought of joining it.
I am planning to write Image processing application.
Ok ill tell you all my basic requirement...
I have to basically develop an ip application with operations like contrast stretch, filters, emboss zoom etc. but with the ability to PLUG IN new filters and other image processing features. A standard "plug-in" interface would need to be developed and the choice of interface method would need to be clearly justified and designed. Only a sub-set of image processing "plug-ins" need be developed in order to demonstrate the functionality of the interface. The usability of the application, efficiency of the algorithms and ease of plug-in development are essential requirements.
Now i am new to this field. I am going through few image processing articles in this site. Its quite interesting but i am confused about the above mentioned requirement.
How to achieve this ? I mean how to make a standard "plug-in" interface to "ease of plug in development". And any suggestion how should i proceed and what all functionality should i be looking for? I am new i dont know much of the functionality i could include in it. Well i am going through this article by christian and trying to figure out different filters he mentioned.
Please help this new comer.
One is image processing, which is a broad and interesting field; there are lots of articles
on that, and you have found at loeast some of them, so thats OK.
the other is plug-in technology. There are CP articles on that too, such as this one[^].
The good thing is both issues are "orthogonal", i.e. there is no real interaction
between them; plug-ins offer comfort at the expense of some performance reduction
(the method calls towards the external functionality is somewhat more expensive),
but if the external methods are sufficiently heavy (as in processing an entire image)
they happen only so often and their cost becomes completely irrelevant.
To be very honest i really dont know anything about plug in technology at the moment. Thanks for pointing me that article. Ill go through it.
The only point coming in my mind was like how could i include new features and new filters through UI. I mean i might sound bit stupid here but please forgive as i am new to this area. I think to add any features i need to write code for the application and adding new filters or any more features means write more code..isn't it.
So i have not read anything about plug in technolgy yet..ill be doing this now...but i am curious to know how does this plug in system work..How can i add new feautures without writing code for it...hmmmmmm sorry if it was too basic...
Ill go through googles aswell in search of plug in technology.
Yeh i am going through your articles only at the moment. Thanks for the great articles.
hmmm okay, but lets say for instance my application has got invert filter and greyscale filter.
Now after some time i want to add say brightnes filter. But i dont have any methods already written for this filter. So i wont be able to add this filter in UI. M i right ?
Or do you mean that while creating application i should keep all the possible filters in mind and create suitable methods and keep it in a dll file so that if later i want to include that i could do it dynamically....Is this what the requirement expect me to do.
Thanks for giving me your precious time.
plug-in technology will allow your app to discover what plug-ins are currently available,
and interrogate them; typically the plug-ins would implement a common Interface that
provides access to at least two methods, say:
- GetName() which returns a name that can be used to add it to a Menu, or a
ComboBox, so the app user can choose it;
- Execute() which would do what your group of plug-ins is intended to do, in your
case process one Image.
In a more complex situation each plug-in might offer one OptionDialog that gets
invoked in a standard way (again that Interface), but allows the user to interactively
set a lot of very plugin-specific options.
about plug-ins it's all about making them all behave under the same rules...same calling conventions and same expected behaviour >> Interfaces.
In order to make use of a plug you just need to make your app be able to load them up in runtime and configure the UI dinamically once it reads what plug ins are available. With a little Reflection that is easy and you can choose quite a few paths.
Easiest I can think of right now is making your app, on start up, search some predefined folder(s) for any dlls and try to load them up. Once loaded, through Reflection you can search for public classes that implement your plugin interface.
A fast thought and probably not ideal interface could be:
public Interface IPlugIn
Image ProcessImage(Image imgh);
Form PluginDialog(Image img) (which in turn can implement some other standard interface you might define), etc.
For each of these classes, you add a menu item or whatever with it's name through GetName() method, and map the click event to the relevant call (be it PluginDialog, or directly ProcessImage() or whatever)
With that info you can configure your UI and mapp all calls the user can make in order to use any of the loaded plugins. Its a little more cumbersome because you have to do it through reflection because the Assemblies you are calling are not referenced while in design time and you can't call them directly from your code.
I've got some C# code that zooms in on an image contained in a Panel, and moves that panel's scroll bars to center on the place that was clicked on with the zoom tool. However, when I set the Value property of the ScrollProperties as shown below, the value stays the same unless I execute the same code twice in a row, as shown below. If I do it only once, it will center correctly, but the actual scroll bars will not move until the next set of the .Value property. Any ideas why?
///<summary>/// Positions the vertial and horizontal scroll bars by the given X and Y offsets
///</summary>privatevoid CenterScrollBars(int X, int Y)
//horizontal scroll bar first
HScrollProperties hsp = MainPanel.HorizontalScroll;
if (hsp.Visible) //if we don't have a scroll bar, don't try moving it!
//calculate the offset to move the scroll bar in order to center on the clicked point//since the point uses the DrawingBox's coordinate system, we need to move it into the//containing panel's coordinate system first by doing a shiftint offs = (X + DrawBox.Location.X) - (MainPanel.Width / 2);
VScrollProperties vsp = MainPanel.VerticalScroll;
if (vsp.Visible) //if we don't have a scroll bar, don't try moving it!
//same idea as aboveint offs = (Y + DrawBox.Location.Y) - (MainPanel.Height / 2);
///<summary>/// Moves the scroll bar by the specified offset, clamping to min or maximum if needed
///</summary>///<paramname="sp">The scroll bar to move</param>///<paramname="offset">The offset by which to move the scroll bar.</param>privatevoid MoveScrollPosition(ScrollProperties sp, int offset)
int val = sp.Value + offset;
//clamp the value to the min and max values of the scroll barif (val < sp.Minimum)
val = sp.Minimum;
elseif (val > sp.Maximum)
val = sp.Maximum;
sp.Value = val;
sp.Value = val; //TODO -- investigate this problem, scroll bar position not updated properly unless this is done twice
If you follow the UpdateScrollInfo call - it ends up calling into the Windows API and calling SetScrollInfo on the control...
If you follow SetDisplayFromScrollProps call it ends up calling a function called ApplyScrollbarChanges - which is one of the longest MS functions I have seen in a while - I'd look at the logic of that function and see if that is doing something weird....
Be interested to know if you crack the issue - my belief is that the first call fails (or appears to do nothing) - also maybe it's something simple like the control needs to be updated to reflect the change and ultimately calling the Value set property a second time causes that...
I've been able to reproduce the problem in a more simple environment. I have a Form that has one panel inside of it. Pressing "L" makes panel expand by 10 pixels each time, and programatically sets the scroll bar position if it is visible, and prints out the value.
This code produces output:
the first time you click L, and 5 every time after.
I just installed SQL 2005 enterprise, (SQL 2000 already installed but stopped)now when i try connecting to the SQL 2005 instance i keep getting the following errors
"Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection."
Tried almost everything, changed the SQL Server's auth. mode from Windows only to Mixed mode.
Any suggestion plz.
"Mess with the Best, Die like the rest"
Last Visit: 31-Dec-99 18:00 Last Update: 8-Aug-22 22:02