|
That looks like the baby!
Many thanks
|
|
|
|
|
hi
I'm a Korean student.
I'm studing C# and image processing.
I am reading a book, the book's name is GDI+ Programming wrote by you.
I'm studnig 16bit RAW image file.
But I did'nt display on screen.
How can i do?
please help and detail information.
-----my programming source is here -----
FileStream fs = File.Open(strFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
BufferedStream buf = new BufferedStream (fs);
BinaryReader r = new BinaryReader(buf);
Bitmap bitmaps = new Bitmap (_Define._ImageWidth, _Define._ImageHeight, PixelFormat.Format16bppGrayScale);// .Format48bppRgb);
BitmapData bmData = bitmaps.LockBits (new Rectangle(0, 0, _Define._ImageWidth, _Define._ImageHeight), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale);
bitmaps.UnlockBits (bmData);
UInt16 *p = (UInt16 *)(void *)bmData.Scan0.ToPointer();
UInt16 swap;
int nTotal = _Define._ImageHeight*_Define._ImageWidth;
byte [] data = new byte [nTotal];
try
{
int nPer = nTotal / 10;
int nCnt = 0;
for(int y = 0; y < nTotal; y++) // 원본을 로드하기위한 For문...
{
if (y%nPer == 0) {
pLoading._Percent = nCnt;
nCnt += 10;
pLoading.Refresh ();
}
swap = (UInt16)(r.ReadInt16 ());
*(p) = swap;
p++;
}
}
catch(Exception fo)
{
MessageBox.Show(fo.ToString());
}
// m_pPanel is View
MDProcess.ImageObject pImage = new ImageObject (m_pPanel);
pImage._ImageName= strFileName;
pImage._rcBound = InitImagePT (iFiles);
pLoading._Percent = 100;
pLoading.Refresh ();
m_alImageList.Add (pImage);
pLoading._Counter = i;
pLoading._Total = alFiles.Count;
pLoading.Refresh ();
bitmaps.Dispose ();
fs.Flush ();
buf.Close ();
fs .Close ();
r.Close ();
|
|
|
|
|
Hi everyone
In the .NET Compact Framework (C#) I have created a TCP server socket using BeginAccept. After the connection is established (EndAccept) I use BeginReceive for asynchronous data receive. When the program exits the socket will be closed, but the thread: System.Net.OSSOCK.recv is hanging and the program after the exit still exists and is locked.
How can I terminate the asynchronous reading before closing the socket?
Thank you for any help.
Joerg
|
|
|
|
|
Hi all
I have a custom usercontrol in my window form "frmsett.cs" .
"initializecomponents" of "frmsett.cs" initialises usercontrol
This usercontrol is derived from a base component class.
Usercontrol populates printer informations.
we populate default printer related informations to usercontrol through Pinfo() method (a function in base component class )
Pinfo() invokes getinfo()(another function in base component class ) using methodinvoker and asynccallback
My "basecomponent" class definition starts with
[ClassInterface(ClassInterfaceType.None), ComVisible(false)]
when i call frmsett.showdialog() Applcation is developed and works perfectly in .NET framework 1.1
Then I installed .NET framework 1.1 SP1
Here the problem begins. When application executes ShowDialog(Only at first call) It hangs for some minutes (5-15 mins) before showing the dialog "frmsett" . If we clicked second time it will display the screen immedialtely.
Anyone come across this type of issues???
Is there any problems asynccallback with methodinvoker in .NET fx1.1 SP1
What is the reason for this problem in .NET fx1.1 SP1???
Thanks a lot for any tips !!!!
Regards
Krishnan
If u can Dream... U can do it
|
|
|
|
|
Hi
This is mratyunjaya.I am working on a project,of which one
module is photo gallery.I am looking for source code of this module.Can anyone help me,required source code in
C#.net or asp.net.
U have already seen this functionality in yahoo photo album
or others photo galleries projects.
Regards
Mratyunjaya
|
|
|
|
|
Good! You've heard of Yahoo!
Now trying typing this in the "Search the web:" box:
photo album gallery source code c#
Happy hunting!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
How to have the SetItemData and GetItemData property like in MFC listview in
C# Listview ???
Any help will be appreciated.
Saleem
|
|
|
|
|
Check the ListViewItem.Tag property. You can store anything in there, be it an int or a reference to a big object.
If you want to store more than one object, make a little class with public methods for each object, and then store a reference to that object in the Tag property of each item.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
In C#, how to change/increase the size for a byte array buffer to be sent over a tcp stream?
on the server side, i have something like this:
while(i != 100)<br />
{<br />
streamWriter.writeline("data");<br />
}
Now, on the client side, i saved every data sent to me. However, only half or so of the data is being sent, the last line in my data.txt file says "unable to read data from the transport connection". And i think it has something to do with the buffer size. So i need to increase it...
THanks for the help.
|
|
|
|
|
hi,
what is the API or classes in c# which used to create a new folder ???
Thanks
|
|
|
|
|
Hi best_students,
We can use Directory class which is avaliabe in System.IO namespace for creating new folder. This class provide static methods for doing this.
string path =@"C:\Training\Test";
if(Directory.Exists(path))
{
}
else
{
DirectoryInfo drinfo = Directory.CreateDirectory(path);
}
Guess this will help you.
Thanks
SGS
|
|
|
|
|
|
Ok, so I have a number of ‘modes’ for a control I wrote (List View: Detail, Large Icon, and so on). In the designer it is convenient to have an enumerator drop down, consisting of these modes, which a user can select. However, each mode is actually a subclass. So, I was wondering if there is some cool and/or strange way to have an enumerator that contains all subclasses found in the assembly/dlls. This would allow someone to add a new subclass with out also editing the enumerator containing the names of all the subclasses. Yes/No/Thoughts?
|
|
|
|
|
It is possible to do this using Reflection. Use the GetTypes() method on the Assembly class, iterate through the types and filter subclasses using the Type.IsSubClassOf() function.
Regards
Senthil
|
|
|
|
|
Does anyone know if it's possible to provide a command line switch to make the .NET framework install silently ? Also, does anyone know where ( presumably in the registry ) to check what versions are already installed ?
Thanks
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
if it's possible to provide a command line switch to make the .NET framework install silently
No it's not (as far as I know, but I already researched this before.)
Christian Graus wrote:
where ( presumably in the registry ) to check what versions are already installed
Check the folders in C:\Windows\Microsoft .NET\Framkework\v1.xx.xxxx . 1.1.4322 is 1.1 SP1, for example... and 1.0.3705 is 1.0 SP1 (not really sure on that one, but Heath mentioned it in this same forum some days ago.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Please suggest how to convert DateTime.Now to FILETIME structure format?
Sandeep Naik
|
|
|
|
|
Hi Sandeep
Guess you can use DateTime.Now.ToFileTime(); method.
Thanks
SGS
|
|
|
|
|
DateTime.Now.ToFileTime() returns long.. FILETIME is structure. Pls let me if you have someother idea
Sandeep Naik
|
|
|
|
|
Hello there, I have code that's something like
lock ( this )<br />
{<br />
bKeepTrying = true;<br />
while ( bKeepTrying && watcher.EnableRaisingEvents )<br />
{<br />
try<br />
{<br />
ReadAndProcessFiles(...);<br />
<br />
bKeepTrying = false;<br />
}<br />
catch( IOException )<br />
{<br />
myLog.Info( "Waiting for files to finish copying... retrying in 5 seconds..." );<br />
Thread.Sleep( 5000 );<br />
}<br />
catch ( Exception e )<br />
{<br />
myLog.Error( "Error processing files.", e );<br />
}<br />
}<br />
}
And it's weird because I suddenly encountered an error with this stack trace:
The process cannot access the file "\\data\data1.raf" because it is being used by another process.<br />
at System.IO.__Error.WinIOError(Int32 errorCode, String str)<br />
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)<br />
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)<br />
at System.IO.File.OpenRead(String path)<br />
at MyProject.ParseFile(String sFile)
It's my first time encountering an error that is could not be handled by exception handlers. Any idea how this happened and how to fix/avoid this?
Thanks so much!
~Rafferty
|
|
|
|
|
There are two way to avoid this error.
1) Close your file imeediatly once your worjk get finish.
2) Use StreamWriter instead of File object
Hope issue resolved.
Thanks
Nadir Riyani
|
|
|
|
|
Hi,
How to get familiarize with VisualC#/.Net classes and functions?
Are there any Hierarchy charts like MFC?
Thanks
Vinay.
|
|
|
|
|
Here's[^] a listing of all the namespaces in the library. I couldn't find a hierarchy chart -- perhaps it would be way too large to show.
I would start with becoming very familiar with the .NET language you want to use. Then choose a specific type of app you want to develop (Windows or web) and begin looking at online tutorials for those. Books may also help.
Regards,
Alvaro
You know what they say about arguing over the Internet...
|
|
|
|
|
Is swithching from winforms to webforms and viceversa is a simple task or does it have it's own learning curve?
Let us say, I have a simple GUI like calculator in Winforms. Can I convert the GUI of calculator into webform(assume the logic is provided by some server).
Thanks
Vinay
|
|
|
|
|
No way. Windows Forms concepts don't map directly to Web Forms. Yes, Web Forms has it's own learning curve.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|