|
marshalled? unmanaged? wtf?! i only want to set a single pixel!!!
it seems, i will try the fillellipse-thing...
but thx for the tip!
:wq
|
|
|
|
|
Here is the code,
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
static public extern int SetPixel(IntPtr hdc, int x, int y, int rgb);
SetPixel(dc,x,y,rgb);
And I swallow a small raisin.
|
|
|
|
|
phew. that works. thx!
anyways - i still don't understand why ms doesn't include a DrawPoint(Pen,int,int) or DrawPoint(Pen,pt) function into the graphics-class.
:wq
|
|
|
|
|
I guess for known performance reasons MS didn't think that was a good idea to allow DrawPoint. Well to be honest, the fact that DrawLine(x,y,x,y) does not work properly is a bug.
DirectX+GDI advocates have been fighting for years to train developers to lock a ptr to an actual surface, and then poking inside, instead of doing silly SetPixel loops. For real world apps such like real-time imaging, locking surfaces is of course the recommended solution,
And I swallow a small raisin.
|
|
|
|
|
hmm. might be a reason. when i think it over, i could have created a bitmap before the operation, set the pixels within the bitmap and draw the bitmap at the proper location...
i see there's a trade-off between 'amount of code' and 'drawing speed' - but in my simple case the setpixel-speed is abolutely ok.
:wq
|
|
|
|
|
FillEllipse(,,,1,1) does not solve the problem
going marshalled...
:wq
|
|
|
|
|
MS recommends to use GDI (Marshalled)
where do you know that from? how does someone get to know what MS recommends...?
:wq
|
|
|
|
|
SetPixel
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
i don't want to draw on a bitmap but rather on a graphics-object
:wq
|
|
|
|
|
Hi,
I've developped a little application to communicate by serial ports in .NET. It uses Kernel32 API the same way the communication was done on VC++ 6.0.
When I had finished it I copied it to a W98 computer with the .NET Framework already installed. The problem is that I get an exception just when I try to execute it and nothing works (neither the form is shown, only the error message).
I tried it on another W2k and gets an exception on "unknown module" about a "invalid URL direction".
Does anyone knows what's happening?, maybe I should make an installation project for it?
Thanks in advance,
EdgarBM
Edgar Berengena Moreno
Software Engineer
Appeyron Research
|
|
|
|
|
Is the program relying on a dll that isn't included in the .NET Framework? That could be the problem.
David Stone
It seemed similar to someone saying, "Would you like to meet my knife collection?"
Ryan Johnston on Elaine's sig
|
|
|
|
|
Hi,
thank you for your reply.
I'm using API "Kernel32" the functions:
WriteFile
ReadFile
GetLastError
CloseHandle
CreateEvent
SetCommTimeouts
GetOverlappedResult
WaitForSingleObject
...but I realized that if I execute the program locally (note remotelly) it executes, although it doesn't works fine because those functions doesn't work.
Do you have any idea about it?
Thank you again,
Edgar
Edgar Berengena Moreno
Software Engineer
Appeyron Research
|
|
|
|
|
anyone tried using directX from c#?
I know that the next version will be .net compatible, but I am wondering if its been tried with the current version - maybe with the vb version of the directx lib?
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
have a look at this article here on codeproject in the C#-section
it's about writing a media-player in C# using DirectShow, and as far as i understood (never ever having written a single line of vb-code) it does use the vb-libs
:wq
|
|
|
|
|
Couldn't believe my eyes when I ran it the first time, but this program decompiles the whole .Net framework IL source code,
And I swallow a small raisin.
|
|
|
|
|
Yes, its nice, but it does crash alot
If u want some more source code, download the MONO source, also very helpfull especially when u want to extend .Net classes.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
I thought at first sight that Mono was really far from a user-friendly repository of .Net source code, but...
While we are at it, let's check out Salamander. I hate their Java demo but their desktop app looks fine and powerful too.
Within a few hours so many tools to hack down the closed code. I thought until this morning that switching from MFC to C# I was being ligotated by MS. Now no more. Let it begin!
And I swallow a small raisin.
|
|
|
|
|
Amazing isn't it?
To cover the places where it crashes, ildasm does the job nicely for me.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Eh...eh....
Not a single crash for me. Used since 8 AM this morning (it is 16 PM).
And I swallow a small raisin.
|
|
|
|
|
I've only found a few methods that crash it for me. One of the paint event methods seemed to do it, PaintWithErrorHandling in the Control class IIRC.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
maybe I just try to view the wrong stuff
Try some dll's with a combination of unmanaged/managed code and it tends to crash on some functions.
But I'll take James's sugestion and use IDLDASM
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Well huhaaaaa Crashed too!
Will try recompile and debug Anaconda this WE or something. Will flag you if I get this bug down,
And I swallow a small raisin.
|
|
|
|
|
I have tried to recompile Anakrino this WE, but a few main files and projects are missing from the source repository. Thus I and you will have to live with the GPF,
And I swallow a small raisin.
|
|
|
|
|
Which methods do i need to override to put myown drawing code in a tree view, for when it is drawing the nodes?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I have been trying to figure out, and search for how you can override the normal closing operation of a Form when a user hits the 'X' button, so that it just HIDES the form instead.
The closest I found in a forum someplace was they said to override OnClosing if you want to change how to handle the 'X' button default operations.
Like so:
protected override void OnClosing(CancelEventArgs e)
{
this.Hide();
}
However this does not work. The form is still disposed of, and when I try to show the form again I get an exception say just that.
Does anyone know how to do this, or can point me to an article or forum message someplace that explains this?
Thanks in advance...
Aalst
|
|
|
|