|
|
|
The message from Thomas says that you need to recompile PDFSharp (specifically the PdfSharp.Charting assembly) with the changes he's suggested.
You can find both classes in the folder: PDFsharp\code\PdfSharp.Charting\PdfSharp.Charting.Renderers
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi!
Works great! But i also had to add
using PdfSharp.Pdf
to RendererInfo.cs, to make the application run.
Thank you very much!
|
|
|
|
|
Hello. I am placing 4 dots on an image (1280x720) using mouse click. Now I crop this image of size just bigger than these 4 dots (coords). How do I place the 4 coordinates on the cropped image ? Thanks for any pointer.
|
|
|
|
|
If you place the 4 dots, then crop the image to a size that is larger than the hypothetical rectangular bounding region enclosing the dots: q.e.d. they are visible on the cropped image.
So the question becomes: what principle/rule/heuristic do you want to apply to re-positioning the dots.
Are there any constraints on where the dots are placed initially, or what their relationship is with each spatially ?
Details, please.
« I am putting myself to the fullest possible use which is all, I think, that any conscious entity can ever hope to do » HAL (Heuristically programmed ALgorithmic computer) in "2001, A Space Odyssey"
|
|
|
|
|
Actually these 4 dots represent the four coordinates of a rectangle that I use to crop the image. And yes, the cropped image is bigger than the 4 dots. Now I have no clue what should be done to redraw the dots on the cropped image. (This is knows as "re scaling" perhaps.)
modified 31-Oct-14 3:21am.
|
|
|
|
|
I think my head is a little slow today, so bear with me: if you use the 4 dots to define a rectangle for cropping, and the cropping is performed, do you then need to show the 4 dots after the crop ?
It's a typical convention in UI design for resize/crop "handles" to appear when some run-time object is selected, but perhaps you are working with a different design idea ?
« I am putting myself to the fullest possible use which is all, I think, that any conscious entity can ever hope to do » HAL (Heuristically programmed ALgorithmic computer) in "2001, A Space Odyssey"
|
|
|
|
|
BillWoodruff wrote: I think my head is a little slow today, so bear with me Well perhaps you are not slow. May be its me who is new to this.
BillWoodruff wrote: ... and the cropping is performed, do you then need to show the 4 dots after the crop Yes I need to show these points on the cropped picture. Yes the image is cropped. But will the 4 points not be repositioned since first the point was X1Y1 = 640,550 but now after the cropping this point could/should be X1Y1 = 40,50 .
|
|
|
|
|
Yes, if you re-position the cropped image, the "dots" will need to be relocated. However, if you did the crop in a way that positioned the cropped image so its new bounding-box was in the same position as that area was in pre-crop, then you would, perhaps, not have to re-position the dots.
If the "dots" are same-sized circles, you'll know that the key offset is the diameter of the circles, and you can re-position based on:
// assuming
private const int diameter = 6;
dotUpperLeft.Location = new Point(image.Left, image.Top);
dotUpperRight.Location = new Point(image.Right - diameter, image.Top);
dotLowerRight.Location = new Point(image.Right - diameter, image.Bottom - diameter);
dotLowerLeft.Location = new Point(image.Left, image.Bottom - diameter);
Does this make sense ?
« I am putting myself to the fullest possible use which is all, I think, that any conscious entity can ever hope to do » HAL (Heuristically programmed ALgorithmic computer) in "2001, A Space Odyssey"
|
|
|
|
|
So, I've got an open question on so
We're experiencing cors issues with signalR resources and I can't imagine that I'm the only one that has had to solve this problem. The "default", documented configuration settings for enabling cors with signalR are
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR();
}
but CorsOptions.AllowAll configures wildcard Access-Control-Allow-Origin and you cannot specify a wildcard value AND use withCredentials. So I'm investigating what it would take to create a custom Microsoft.Owin.Cors.CorsMiddleware or create a different CorsOptions setting.
Does anyone have an example that replaces
app.UseCors(CorsOptions.AllowAll)
with
app.UseCors("CorsOptions with a CorsPolicy that doesn't specify wildcard origins")
"I need build Skynet. Plz send code"
|
|
|
|
|
so...when the heck did nested object initializers become good form???
(Note that this seems to be the only way to interact with the Origins collection. Once the CorsOptions object is constructed, there is no direct access to the properties on the PolicyResolver)
CorsOptions cors = new CorsOptions
{
PolicyProvider = new CorsPolicyProvider
{
PolicyResolver = context =>
{
var policy = new CorsPolicy
{
AllowAnyOrigin = false,
AllowAnyHeader = true,
AllowAnyMethod = true,
SupportsCredentials = true
};
policy.Origins.Add("http://localhost");
}
}
};
app.UseCors(cors);
"I need build Skynet. Plz send code"
|
|
|
|
|
Hello, here I leave a code to copy a website to generate a text cursor type, but it always returns the text as if it were in Bold, as it could put the text Regular style
#region New_Cursor definition
public struct IconInfo
{
public bool fIcon;
public int xHotspot;
public int yHotspot;
public IntPtr hbmMask;
public IntPtr hbmColor;
}
public void New_Cursor(string text)
{
Font drawFont = new Font("Verdana", 9);
SolidBrush drawBrush = new SolidBrush(Color.Black);
Bitmap bitmap = new Bitmap(100, 25);
Graphics g = Graphics.FromImage(bitmap);
g.DrawString(text, drawFont, drawBrush, 0,0);
this.Cursor = CreateCursor(bitmap, 3, 3);
bitmap.Dispose();
}
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);
[DllImport("user32.dll")]
public static extern IntPtr CreateIconIndirect(ref IconInfo icon);
public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
{
IntPtr ptr = bmp.GetHicon();
IconInfo tmp = new IconInfo();
GetIconInfo(ptr, ref tmp);
tmp.xHotspot = xHotSpot;
tmp.yHotspot = yHotSpot;
tmp.fIcon = false;
ptr = CreateIconIndirect(ref tmp);
return new Cursor(ptr);
}
#endregion New_Cursor definition
modified 30-Oct-14 11:26am.
|
|
|
|
|
Why leave it here? What would we want with it?
|
|
|
|
|
|
|
If you're trying to leave a tip/trick or a hint on how to do something, this code is very poorly written and leaks resources.
If you're trying to ask a question, you never specified what the problem is or even attempted to ask a question about the code.
|
|
|
|
|
What does that code have to do with copying text from a website?
|
|
|
|
|
Hi!
I tried to read a CSV data and show its graph in the GUI with VisualStudio. My Code is:
private void button1_Click_1(object sender, EventArgs e)
{
string file = @"C:\Main";
string ConStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file + ";Extended Properties=\"Text;HDR=Yes;FMT=Delimited\"";
OleDbConnection myConnection = new OleDbConnection(ConStr);
string query = @"select * from [test.csv]";
OleDbCommand myCommand = new OleDbCommand(query, myConnection);
myCommand.Connection.Open();
OleDbDataReader myReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
DataTable tb = new DataTable();
using (OleDbDataAdapter ad = new OleDbDataAdapter(query, myConnection))
{
ad.Fill(tb);
}
chart1.Series["Test"].Points.DataBindXY(myReader, "Date", myReader,"Value");
chart1.Series["Test"].ChartType = SeriesChartType.Spline;
myReader.Close();
myConnection.Close();
}
The problem is that he can't find the second column (Exception). But if I change the "Value" in
Points.DataBindXY(myReader, "Date", myReader,"Value");
to "" he prints the graph where the Y-Axis seems to be broken.
How can I show the graph correctly?
|
|
|
|
|
I have one web service which hosted so many place, Now I want to test that web serivce in my unit test program. currently I am doing, entry of IP address in host file each time before testing. Now I want this should programatically change IP address throgh code.
Means, only change IP address of server and call web service.
Please tell solution, how i can change IP addrss of web service runtime?
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Frankly, I can't work out what the heck you are trying to do, much less what help you are looking for!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
You can't change the IP address of the service itself through code. That is a network configuration change.
However, it sounds like you want to change the IP you are connecting to, and not the IP of the actual webservice. Just create a config file and use System.File namespace to read it in and parse it however you want.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Why not just use the Url rather then the ip address?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Thank you for reply.
actual prob.
I have one web service "http:/devemployee/getemployeedetail.asmx" which deployed on 3 server
server1 IP : 123.123.122.11
server1 IP : 123.123.122.12
server3 IP : 123.123.122.13
here web service DNS name same but hosted in different server.
in my client app, i am consuming this web service. so whenever i want to test web service i have to manual change ip adderss of web service in host file and do the testing on that server. is it possible change ip address in code level.
|
|
|
|
|
Hello. I have got this multithreaded video player desktop application. Now this is my first experience with multithreaded apps so I don't know a lot of things. One thing that I can tell is that this application is running with 32-34 threads (using Resource Monitor) and CPU jumps from 2%-6% to 58%-62% . Starting
- from analyzing the code that takes this much CPU
- to remedy this problem
What could I do to reduce this CPU usage ? Should I be modifying the code (to make it efficient) or are there any other things that I could try
This world is going to explode due to international politics, SOON.
|
|
|
|