|
Hello everybody !
My question is quite stupid in Crystal Report but I need your help
Carton | Goods name | Cube of Carton
T1 | A | 0.15 //not suppressed
T1 | B | 0.15 //suppressed
T1 | C | 0.15 //suppressed
T1 | D | 0.15 //suppressed
T2 | E | 0.74 //not suppressed
T2 | F | 0.74 //suppressed
T3 | G | 0.86 //not suppressed
---Total (???)1.75 //not suppress
I need to make a total of Cube of Carton (???). I only calculate the unsuppressed to ???. ??? will be exactly 1.75. When I make Running Total Fields, the ??? is 2.94 instead of 1.75 I need. Help me the exact formula
Thanks in advance !
It seem to be a solution or an answer.
|
|
|
|
|
I test it. I write a cycle that add a image into imageList 1000 times.
But report "virtual memory shortage".
|
|
|
|
|
Hello,
jason_mf wrote: I test it. I write a cycle that add a image into imageList 1000 times.
But report "virtual memory shortage".
So it looks like it's only a question of memory, don't you think!
All the best,
Martin
|
|
|
|
|
How big are these images?
You need a lot of memory to store 1000 images. Either write them to disk instead of holding them in memory, or shove in more RAM.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
is there any way of setting the priority of a BackgroundWorker(b/w) object?
In all other respects the b/w class matches my needs perfectly, I just like to run it a lower than normal priority.
|
|
|
|
|
There isn't a property in the BackgroundWorker class to do it, but inside the worker function the priority can be set directly:
System.Threading.Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
|
|
|
|
|
the answer's always .... obvious, thanks muchly
rgds phild
|
|
|
|
|
My Windows app has a help file in PDF format.
How do I display this file when user clicks on Help command?
Thanks.
|
|
|
|
|
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.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
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.
|
|
|
|
|
You can display pdf file on your form too.
|
|
|
|
|
How can I do that?
Do you have an example code?
Thanks
|
|
|
|
|
You can add the necessary com object from the refernces
|
|
|
|
|
Hello developers,
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.
Regards
James
|
|
|
|
|
Hi James,
you are raising two issues.
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.
So, I wish you welcome, and success.
|
|
|
|
|
Luc Thanks for your informative reply.
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.
Regards
James
|
|
|
|
|
An application can build it's menu and other UI dynamically. It can do this by looking into a dll and finding methods it is able to call.
On the image processing, I have a series of articles and there's at least one other that covers some stuff I do not.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
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.
Regards
James
|
|
|
|
|
Hi James,
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.
|
|
|
|
|
|
Hi James,
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
{
string GetName();
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.
Hope this helps.
|
|
|
|
|
Hey all,
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?
private void CenterScrollBars(int X, int Y)
{
HScrollProperties hsp = MainPanel.HorizontalScroll;
if (hsp.Visible)
{
int offs = (X + DrawBox.Location.X) - (MainPanel.Width / 2);
MoveScrollPosition(hsp, offs);
}
VScrollProperties vsp = MainPanel.VerticalScroll;
if (vsp.Visible)
{
int offs = (Y + DrawBox.Location.Y) - (MainPanel.Height / 2);
MoveScrollPosition(vsp, offs);
}
}
private void MoveScrollPosition(ScrollProperties sp, int offset)
{
int val = sp.Value + offset;
if (val < sp.Minimum)
{
val = sp.Minimum;
}
else if (val > sp.Maximum)
{
val = sp.Maximum;
}
sp.Value = val;
sp.Value = val;
}
Thanks!
|
|
|
|
|
Hi,
I checked my code and I dont have this phenomenon; my scrollbars listen to every
single Value change they get.
But maybe it is caused by the way you have your Controls nested.
|
|
|
|
|
Not sure why - but I just opened up System.Windows.Forms in reflector and looked at the Value property - the set_value has the following code;-
<br />
public void set_Value(int value)<br />
{<br />
if (this.value != value)<br />
{<br />
if ((value < this.minimum) || (value > this.maximum))<br />
{<br />
throw new ArgumentOutOfRangeException("Value", SR.GetString("InvalidBoundArgument", new object[] { "Value", value.ToString(CultureInfo.CurrentCulture), "'minimum'", "'maximum'" }));<br />
}<br />
this.value = value;<br />
this.UpdateScrollInfo();<br />
this.parent.SetDisplayFromScrollProps(this.HorizontalDisplayPosition, this.VerticalDisplayPosition);<br />
}<br />
}<br />
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...
Mark
|
|
|
|
|
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:
---
0
5
---
the first time you click L, and 5 every time after.
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.L)
{
this.panel1.Width += 10;
if (this.HScroll)
{
this.HorizontalScroll.Value = 5;
Console.WriteLine(this.HorizontalScroll.Value);
this.HorizontalScroll.Value = 5;
Console.WriteLine(this.HorizontalScroll.Value);
}
}
}
Still looking for a fix to avoid this hackeration, and would appreciate it if someone could run similar code on their box.
Thanks,
Phil
|
|
|
|