|
|
I did find this. Hopefully it will do what I need:
http://marcclifton.com/tabid/93/Default.aspx
|
|
|
|
|
Hi All,
One section of my app involves drawing multi point lines over the top of an image. The image scrolls.
I have internally a list of (world) coordinates, and in every OnPaint handler i'm recalculating the screen coordinates that these correspond to, so that I have a Point[] array, which can be used in Graphics.DrawLines
Problem is that the coordinate calculations are rather slow, and profiling the code shows quite a chunk of time wasted in this part of the app.
I can precalculate the coordinates, but they will still need translating as the image is drawn because it scrolls. But this translation would be simple, because it's just linear.
Does anyone know of an optimised way of translating a large set of coordinates? Or will i just need to loop around my list and do it that way?
Thanks
Jon
|
|
|
|
|
Hi Jon,
the easiest approach would be to rely on Graphics.TranslateTransform(); this will
cause the calculations to occur everytime OnPaint runs, but they will happen in the
most optimized way Microsoft has implemented in Graphics.
One way to speed up things even more is to somehow avoid painting stuff that will
be clipped away due to the scrolling; this requires you keeping all your stuff
in an ordered fashion so you can skip those parts that fall definitely above
the currently visible part, as well as those parts that definitely fall below it.
Of course these decisions could be based on world coordinates.
Depending on the dynamics of your app, you may also consider drawing the image
and all the lines once in an off-screen buffer (Bitmap), and show only the
relevant parts as needed.
Hope this helps.
|
|
|
|
|
Hi Luc,
Thanks for the comments.
TranslateTransform looks like it's going to be really helpful, I shall experiment and see if it makes some performance gains.
I already only draw approximately what is needed. I simplified a little in my post - the image is actually a grid of image tiles, which are usually in the region of 150px by 150px. Each image tile has it's own list of coordinates which are on top of it, which are calculated at the start. I have logic to tell which tiles are in view in any given OnPaint call, so I only do extra line drawing where a tile is clipped by the edge of the window.
Thanks
Jon
|
|
|
|
|
Hi Friends,
I am using asp.net with c#.I am new to Chain Verification Process.i need to verify client certificate with root certificate of the server .in that i was struck with verifing the publickey.i am able to dispaly the Thumbprint and publickey of the certificates but i am unable to verify that Thumbprint and publickey.
It is greatful to give an example which is help to me
Cheers,
Happy Coding
|
|
|
|
|
Hello everyone.
I’m .NET developer (VB.NET). At the company I work I use VS 2003 and .NET Framework 1.1 to develop different tools (web based and windows based) to replace some of the process in my company, basically make some tasks easy to do.
My company is evaluating SharePoint Server 2007 (MOSS) to get us company Intranet and of course use document management and other collaboration tools that SharePoint has to offer. Of course I will be programming in C# and that’s why I’m in the middle of adapting to the new language.
Did anyone have any experience with SharePoint development and/or customization? I would like to get any information as I can get: links to the sites, books, etc. Basically anything that can help me to get started. Please consider me as new user and I know nothing about it. Where do I start (especially development for SharePoint)?
I found the following books at Amazon.com. Do you think these would be enough or I will need anything else?
http://www.amazon.ca/Professional-SharePoint-2007-Development-Holliday/dp/0470117567/ref=pd_sim_b_3/701-8834183-4638738?ie=UTF8&qid=1181779059&sr=8-1
http://www.amazon.ca/Beginning-SharePoint-2007-Building-Solutions/dp/0470124490/ref=pd_sim_b_3/702-7805079-5962455?ie=UTF8&qid=1181779059&sr=8-1
Thank you very much for your help.
|
|
|
|
|
I have a program where i need to display an image in a picturebox & have users be able to select a part of the image for printing. I haven't be able to find any method of accomplishing this. I've tried drawing a rectangle on the image but drawing and re-drawing the image take far too long (these are very large images).
Any ideas/links?
Thanks
R.Myers
|
|
|
|
|
It is obvious to use rectangle to allow user to draw from source x,y coordinate to destination x,y coord. BitBlt()(Bitmap Block Transfer) available in VC would help to do ur task easily.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
Thanks for the response. Do you (or anyone else) know of a newbie-type guide to using BitBlt? I've been looking, but i haven't found anything.
Thanks again
R.Myers
|
|
|
|
|
Hello,
If the listview control is populated with items, and user preses for example key "r", the list view control scrolls to the first object in the listview control whose text starts with letter "r". How can I achive this programatically? Meaning, if I have a button, and when user presses the button, it sends a key stroke event to listview control with letter "r".
Thank you.
|
|
|
|
|
Something like this:
private void listView1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.R)
{
//search the list view for item
listView1.Items[0].Selected = true;
}
}
|
|
|
|
|
Thanks.
But ListView control already has a default behaviour for the key strokes. I was just wondering if I can use API SendMessage somehow to emulate this default behaviour.
|
|
|
|
|
Hello
I am sharing a folder through sharing property. For that, i just right click on the folder and shared it...Now i can easily access this folder from any computer within a network. This is so simple.
Now i have done the same job through C# code. It works properly. But when i access this folder from any computer, it shows an error i.e. access denied.
I am not able to understand the reason.
Plz reply me asap.
Thanks
Devesh Mishra
|
|
|
|
|
I am not sure if that is the problem, but you did not mention security in your post. When you share a folder and you want anyone to access it you need to give permission. Have you done that in your code?
|
|
|
|
|
Yah i have done this in my code.yah the scenario is really amazing.
Suppose there are to system A & B. Then i can access that folder from A but not from B.
This is my out of mind. Why its happening ?????
Devesh Mishra
|
|
|
|
|
With so little information we're unable to help properly.
Are the machines part of a domain? Are the same users trying to access the share? Are you able to access the share from windows explorer? When you do so for the first time after rebooting the computer, does it prompt you for user name and password before allowing you access to the share?
Questions over questions...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
yah all the system are from the same domain. There are two diff users, trying to access the share folder on two diff system. it doesnt prompt for the username and password, after rebooting the system.
Hey i know the whole scenario is really embarrassing... its totally my out of mind..
Thanks
Devesh Mishra
|
|
|
|
|
hi!
How can we use Treeview inside a DataGrid. is any wasy to use the treeview in datagrid if yes plz help me as soon as possible.
|
|
|
|
|
You can put any control inside a datagrid control.To do this follow this steps
1) In the column collection add a template column.
2) Right click and select edit template
3) In the Item template section drag and drop which ever control you like to have.
|
|
|
|
|
Hello,
can someone explain to me what i've done here?
What role does the delegate play? And is the
that correct way to go about setting up an event in
a class?
<br />
void objRecoContext_Recognition(int StreamNumber, object StreamPosition,SpeechRecognitionType RecognitionType, ISpeechRecoResult Result)<br />
{ <br />
this.phrase_recognised(RecognitionType, Result);<br />
}<br />
<br />
public delegate void phrase(SpeechRecognitionType RecognitionType,ISpeechRecoResult Result);<br />
<br />
public event phrase phrase_recognised;<br />
Thanks..
|
|
|
|
|
perhaps i should mention that the 'objRecoContext' object is a 'SpeechLib.SpSharedRecoContext'.
I'm trying to follow one of the articles from this site to make an easy to use speech-command recogniser.
|
|
|
|
|
how to get the values of each row from datagridview and save it in a flat file.DGV is having 3 columns.how can it be done with help of supporting class.
platform-dot Net and C#
|
|
|
|
|
I'm not sure how you plan to get these values into your flat database. I might be able to help more if I knew the type of database. Either way, here's how you can get the values out of the datagrid
private void reader()
{
foreach (GridViewRow r in GridView1.Rows)
{
//The index just represents which column you want to retrieve the values from
string value = r.Cells[0].Text; //column 1
string value2 = r.Cells[1].Text; //column 2
string value3 = r.Cells[2].Text; //column 3
//Add code here insert the values into your flat db
}
}
Lester
http://www.lestersconyers.com
|
|
|
|
|
If the flat file is more specifically ASCII text flat file, then it is better if the file is created from within the C# app.
You can use StreamWriter class to create your flat file and prepare a string by appending values from the Grid View cells and finally write this string to the file.
|
|
|
|