|
I need to divide a very large image (say 5-7 mpx) into smaller pieces (24 bpp Image objects). Algorithm is not a problem, the speed of used GDI+ method is.
Using Graphics.DrawImage() is slow, even when no interpolation is done. The problem is not in the count of pieces, but in the size of huge source image. Doesn't matter how large the pieces are, because the long time is taken by the reading of pixels from source.
I've thought about using unsafe pixel access, but still hope there's some method for obtaining smaller image from larger one quickly.
|
|
|
|
|
Libor Tinka wrote: because the long time is taken by the reading of pixels from source
I wouldn't read pixels. Locate each small piece on the original image and draw it to a separate graphic buffer. Then, you may either save it to a file or render it to the screen.
Best,
Jun
|
|
|
|
|
The drawing to separate buffer (doesn't matter how small the buffer is) is slow when working with large images. Drawing small area of 10 by 10 pixels from position [x,y] using
graphics.DrawImage(srcImage, new Rectangle(0, 0, 10, 10), x, y, 10, 10)
looks fast - try it on 7 megapixel image, it won't be.
|
|
|
|
|
|
Is there any way to get error numbers for errors in the VS error list? I've thought of doing an add-in that sort of replaces the error list and looks up error numbers, but that seems a bit clumsy.
|
|
|
|
|
I don't know how to get them programmically (you might want to try to attach a StreamReader to the csc output).
But you can go to "View" -> "Output".
You will there get the raw output of csc
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Right click the error message and Show Error Help.
At the top of the help window you will see a message like:
Visual C# Reference: Errors and Warnings
Compiler Error CS1501
|
|
|
|
|
I am creating Custom Workflow Activities for our company. One of the main hurdles to this is in order to make the activities easy to use, I need to access to a database. This way, I can present the users with choices for correctly configuring the activities. I have not done a lot with creating UITypeEditors. VS will be initially be used for configuring the properties.
Does anybody have any recommendations/tips for how to go about doing this?
|
|
|
|
|
Hello all,
I'm working on a project written by someone else that links to an encryption library using interop. I'm getting about 50 warnings about types in that assembly that cannot be marshalled by the runtime marshaller and will be passed as a pointer, blah blah.
The fact is, the program is still running. I would like to ignore these specific warnings during the build so I can find any others that may pop up. Replacing the encryption component or changing its interaction with the program is not allowed at this time, so any help would be very useful.
Thanks,
Will
|
|
|
|
|
In the project properties under "Build" you can enter the numbers of warnings to suppress.
There's an edit box named "Suppress warnings:"
#pragma warning disable 1234 will also work
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a windows service called "XcontrolService" programmed in C#.
From a cmd - Batch, i'll start the installed service with net start XcontrolService.
In the OnStart-Method of service, i will do some jobs and on the end i
would like to return a own defined value to batch.
OnStart returns void!, and ServiceBase.ExitCode does not match %ERRORLEVEL% from batch.
Can you help me about this problem?
Thanks!
Kind Regards
Daniel
|
|
|
|
|
OK. I have an project and setup project for it. How can I add or create my own setup dialog in Setup User Interface pane? I want place on it controls like listbox, textbox, in different coordinates...
|
|
|
|
|
Hi:
I am trying to invoke a base class method, but I find I can only walk down 1 level of inheritance. Is there a way to go down more levels with some more explicit way of specifying which level I am interested?
eg.
public class a
{
protected virtual void Method1()
{
...
}
}
public class b: a
{
protected override void Method1()
{
...
}
}
public class c: b
{
protected override void Method1()
{
...
}
}
public class d: c
{
protected override void Method1()
{
...
}
protected void SomeMethod()
{
....
-- here I want to invoke Method1() of class b
base.Method1(); // this would invoke c.Method1()
}
}
Regards, smurfy
|
|
|
|
|
smurfy34 wrote: -- here I want to invoke Method1() of class b
base.Method1(); // this would invoke c.Method1()
That is correct. You call the imediate base, which calls the next base and so on. Skipping a class is not recommended and probably suggests that your design isn't quite right.
|
|
|
|
|
How can I disable JavaScript error messages in axWebBrowser?
|
|
|
|
|
|
I have a dll that is written in c++ and I want to send a char *. Pointer of array of chars.
So, I need a equivalent of:
char *path = new char[300];
some_function(path);
for C# application.
|
|
|
|
|
Hello
Send it as StringBuilder .
Regards
|
|
|
|
|
Can you provide some code sample for this?
I've tried, but no luck.
|
|
|
|
|
Hello
StringBuilder path = new StringBuilder();
some_function(path);
Regards
|
|
|
|
|
Iam sorry, but I haven't managed to solved this.
When I do as you said, I get an errors:
C:\Backup\Development\Current Projects\BlackBox\frmMainForm.cs(980): The best overloaded method match for 'bb.bbox_table_open(char*)' has some invalid arguments
Pointing at: bb.bbox_table_open(s);
And
C:\Backup\Development\Current Projects\BlackBox\frmMainForm.cs(980): Argument '1': cannot convert from 'System.Text.StringBuilder' to 'char*'
Pointing at: s in functions parameter. (s is StringBuilder s = new StringBuilder())
|
|
|
|
|
how do you import the unmanaged code in your C#?
Regards
|
|
|
|
|
Through DllImport.
[DllImport("bb.dll", CharSet=CharSet.Auto)]
[return: MarshalAs(UnmanagedType.SysUInt)]
unsafe public static extern uint bbox_table_open(char *archive_path);
|
|
|
|
|
Hello
Why do you declare it as unsafe? I belive your declaration should be this
[DllImport("bb.dll", CharSet=CharSet.Auto)]
[return: MarshalAs(UnmanagedType.SysUInt)]
public static extern uint bbox_table_open(StringBuilder archive_path);
Try it! Otherwise you'd have to make an unsafe bloock in your code and create tha char* inside it.
Regards
|
|
|
|
|
Now is good. Now it compiles and function now work.
Unsafe was becouse in prototype function (parameter) was char *, but now it makes sense.
Thank you.
-- modified at 7:43 Thursday 14th September, 2006
|
|
|
|