|
hey hi, wanted to ask you guys that whenever I save some path in a column named "Picture", then it doesnt allow me to do so. how can I do it, or what type of column will i have to set it as?
regards,
noman
|
|
|
|
|
Standard question #2:
What error message do you get?
What data type have you chosen for the field?
---
b { font-weight: normal; }
|
|
|
|
|
hi, first of all, i wasn't sure in which forum i could place my article, so i put it in this one, because i'm working with C#...i hope someone could help me
the problem is that i simply can't create a Device in my app, it send me an error about "WindowsApplication1.Form1 is not an IntPtr..look i do something like this
Device dev = New Device(0, DeviceType.Default, this, CreateFlags.None, presentParams)
and the problem is in the third parameter ("this") , but then i don't know what to put in there...and by the way jeje...what is a IntPtr??
i'd really appreciate your help
thanks!
|
|
|
|
|
An IntPtr is a pointer to a memory location; it basically corresponds to a pointer in C++. It is 4 bytes on a 32-bit operating system, and 8 bytes on a 64-bit operating system.
What DirectX really requires is a C++ HWND object. The HWND is, guess what, a pointer to the handle of a window: DirectX is asking you want window to draw on, so it needs the window's handle.
A Windows Form (i.e. your Form class) is just a glorified window with a normal HWND under the covers. You can access the window handle (i.e. HWND) of your form using the form.Handle property.
Device dev = New Device(0, DeviceType.Default, this.Handle, CreateFlags.None, presentParams)
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I have written an application using .NET CF that needs to write back files on a regular basis to a network share, ie \\server\data\foo.txt
How do I specify the username and password of an account that can access the share, so that the device can save to it?
Currently I have to open the share using Explorer on the PDA before I can save to it.
Thanks in advance...
Chris
|
|
|
|
|
Is there a way to import/export a MS Access report so that it can be modified in Crystal Reports XI?
Code Toad
|
|
|
|
|
Hey everybody.
I'm trying to print a document with a right-to-left language. I want to use the drawString() method, but it flips special signs like "." and "!" etc. just like in every other place in windows using this language (and left-to-right mode).
my question is, is there a right-to-left drawString()? or a way to turn this method into right-to-left?
my current solution is using drawString char-by-char using a method I wrote, but it seems like "Bad Programming" and very unefficient.
any ideas ???
Thanks!
|
|
|
|
|
Hi!
I need to flip or mirror a bitmap horizontally loading it from a file and saving the flipped one into another file.
I've seen some piece of code that is supposed to do this, but it uses "unsafe" code. Is there any way to do it without unsafe code?
Here's the code I found:
<br />
public static bool Invert(Bitmap b)<br />
{<br />
System.Drawing.Imaging.BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),<br />
System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format24bppRgb);<br />
int stride = bmData.Stride;<br />
System.IntPtr Scan0 = bmData.Scan0;<br />
unsafe<br />
{<br />
byte * p = (byte *)(void *)Scan0;<br />
int nOffset = stride - b.Width*3;<br />
int nWidth = b.Width * 3;<br />
for(int y=0;y<b.Height;++y)<br />
{<br />
for(int x=0; x < nWidth; ++x )<br />
{<br />
p[0] = (byte)(255-p[0]);<br />
++p;<br />
}<br />
p += nOffset;<br />
}<br />
}<br />
b.UnlockBits(bmData);<br />
return true;<br />
}<br />
Thanx for any help!
|
|
|
|
|
If you surround your code with <pre> and </pre> then the post will retain your spacing. So looking at your formatted code, I end up with mismatch squirrly brackets:
sergestusxx wrote:
public static bool Invert(Bitmap b)
{
System.Drawing.Imaging.BitmapData bmData =
b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
System.Drawing.Imaging.ImageLockMode.ReadWrite,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
for(int y=0;y {
for(int x=0; x < nWidth; ++x )
{
p[0] = (byte)(255-p[0]);
++p;
}
p += nOffset;
}
}
b.UnlockBits(bmData);
return true;
}
}
Looking at the code in general (ignoring the obvious) the reason your unsafe is due to the use of the pointer. (something prefered to be avoided when possible)
Having said that, it looks like it is the only way that you can turn a bitmap into an array-addressable object for inversion.
This looks like a case where unsafe is not avoidable.
-- modified at 13:44 Thursday 20th April, 2006
|
|
|
|
|
You can use the RotateFlip method on the Bitmap class.
Josh
|
|
|
|
|
You can use a Matrix to draw a mirrored image. Look at the Graphics.Transform property.
---
b { font-weight: normal; }
|
|
|
|
|
It depends what you mean by "invert"; are you talking about inverting the colors of the bitmap? Or inverting the orientation of a bitmap?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi,
Is there any way to register a COM dll at run-time, from the code, for example by a certain win32 API call?
Thanks for the help!
Shehzad
|
|
|
|
|
A good start would be to go on the correct forum: COM forum[^]
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi,
Could someone please tell me what is the best way to late bind to COM dlls? I'm basically developing an application that loads specified dlls and then runs certain functions contained in those dlls. The problem is that I don't know the libraries to load until runtime, so I can't really use tlbimp. I know it is possible to use tlbimp at runtime (using TypeLibConverter) but this creates new names for the functions in the dll, so it may not be such a good idea...
Any help would be greatly appreciated, thanks!
Shehzad
|
|
|
|
|
Hi all,
I want to create a .txt file at runtime and fill it with the contents of a string array.
Could anyone help me
Thanks
John 
|
|
|
|
|
Certainly:
Google is your friend[^]
Seeing as you've not specified a) what the string array contains or b) how you want this formatted in the text file - I can provide little help on the latter part.
|
|
|
|
|
Check out System.IO.File.WriteAllLines()
|
|
|
|
|
Please help me
I wouldn't know how to modify my coding
I'd like to use 2 threads running concurrently. Thread 1 reads input 1 character from keyboard at a time. Thread 2 outputs 1 character at a time to the console.
using System;
using System.Text;
using System.Threading;
class Program
{
static String m2 = "Press any combination of CTL, ALT, and SHIFT modifier keys, " +
"and a console key.\nPress the Escape (Esc) key to quit: ";
static String m3 = "You pressed ";
static String m4 = " (character '{0}').";
static StringBuilder sb = new StringBuilder();
public static void Main()
{
bool write = false;
Thread t1 = new Thread(new ParameterizedThreadStart(Program.Input));
Thread t2 = new Thread(new ParameterizedThreadStart(Program.Output));
Console.WriteLine("Thread 1 starting...");
t1.Start(write);
Console.WriteLine("Thread 2 starting...");
t2.Start(write);
}
public static void Input(object param)
{
bool isWrite = (bool)param;
ConsoleKeyInfo cki;
Console.TreatControlCAsInput = true;
do
{
Console.WriteLine(m2);
sb.Length = 0;
cki = Console.ReadKey(true);
sb.Append(m3);
if (cki.Modifiers != 0)
{
if ((cki.Modifiers & ConsoleModifiers.Alt) != 0)
sb.Append("ALT+");
if ((cki.Modifiers & ConsoleModifiers.Shift) != 0)
sb.Append("SHIFT+");
if ((cki.Modifiers & ConsoleModifiers.Control) != 0)
sb.Append("CTL+");
}
sb.Append(cki.Key.ToString());
sb.AppendFormat(m4, cki.KeyChar);
sb.AppendLine().AppendLine();
Console.WriteLine(sb.ToString());
isWrite = true;
} while (cki.Key != ConsoleKey.Escape);
}
public static void Output(object param)
{
bool isWrite = (bool)param;
while (isWrite)
Console.WriteLine(sb.ToString());
}
}
eric
|
|
|
|
|
Eric,
You already posted this code yesterday and now you are back here again without any kind of question indicating what your problem is that you are experiencing. How is anyone expected to help you if we do not know what your problem is. Furthermore I already pointed out the problems you had with your threads...and except for changing your threads you never even made any of those changes.
If you do not know how to modify this code, then you cannot expect us to know what modifications you are trying to make. Posting the same nubulous post over and over again will just eat up server space without getting any answser and getting lots of forum members ticked off.
Michael
|
|
|
|
|
Hello,
Could you please tell me why this code isn;t working(has a problem with update,when i just insert in the table works fine).Thanks
DataRow row=this.dataSet11.Tables[0].NewRow();
row[0]=this.txtNume.Text;
row[1]=this.txtPrenume.Text;
row[2]=this.txtFoto.Text;
this.dataSet11.Tables[0].Rows.Add(row);
this.oleDbDataAdapter1.InsertCommand=new System.Data.OleDb.OleDbCommand(
"INSERT INTO Persoane(nume,prenume,foto) values("+this.txtNume.Text+
","+this.txtPrenume.Text+","+this.txtFoto.Text+")");
this.oleDbDataAdapter1.InsertCommand.Connection=this.oleDbConnection1;
this.oleDbDataAdapter1.Update(this.dataSet11,"Persoane");
this.dataSet11.Tables[0].AcceptChanges();
|
|
|
|
|
Hello All!
Someone know where i can get HTTP Sniffer's source code or read about this ???
Thanks.
|
|
|
|
|
Hi there,
I've got a problem with updating data from an Access database. I just started (for a couple of weeks now) with working with this kind of databases so I don't know a lot about it.
I've got a program that displays data from a database. That's working perfect. But now I want to modify that data.
In one of the tables (I use 3 total) I created an UPDATE query. That happens in this method:
<br />
public void updateFamilie(TypeFamilie updateFamilie)<br />
{<br />
familieData.UpdateFamilieByFamilieID(updateFamilie.FamilieID, updateFamilie.Adres,<br />
updateFamilie.Belasting, updateFamilie.EigenWoning, updateFamilie.FamilieNaam,<br />
updateFamilie.Hypotheek, updateFamilie.Kalender, updateFamilie.KortNieuws,<br />
updateFamilie.Lening, updateFamilie.MobieleTelefoon, updateFamilie.Telefoonnummer,<br />
updateFamilie.Postcode, updateFamilie.Woonplaats, updateFamilie.PriveRekening,<br />
updateFamilie.SpaarRekening, updateFamilie.Verzekeringen);<br />
}<br />
The problem is that the database does not do the update. Can somebody please help me out with this??
Thanks a lot!
|
|
|
|
|
Hi All... Currently i am doing my banking application using ASP.Net,C#, SQL Server2000... i want some technical solution realated securities from you guys as follow..
i already logged to my application by using username and password.. after login page my home page Home.aspx coming on screen.. i have features all like Balance Inquiry, Mini Statement, Last Transaction, Private Banking, Net Banking in my Home Page in left menu side. All Features are working very well.. For Security Reason i want some technical help from all of you guys...
Problem is After my successful login page If i not touch the Home page or if i not click on any features available in home page for 10 minutes.. Like if i click on Balance Inquiry Link after 10 minutes that time Page Login.aspx want to open instead of BalanceInquiry.aspx... After my successful login by username and password i want to open page BalanceInquiry.aspx (do not want open Home.aspx Page Again)... For that what i have to do in my Application to make more secure... if u have any articles link then please send me..
Please Please Help me if you people have some technical solution... Bcz right now i am on mid way of that project... if u have any articles or articles link please help me out....
Regards,
Patel...
|
|
|
|
|
I believe Microsoft Press has a book out called Writing Secure Applications. It is a few inches thick and covers the gambit of what you need to do. You may want to investigate this as a resource for securing your application.
The situation you are experiencing is that your login cookie is set to expire after 10 minutes. I suggest doing some googles for stuff like IIS Security TimeOut and Cookie Expiration and stuff like that. It sounds like you may also need to pick up a book on IIS internals to help strengthen that area of knowledge.
|
|
|
|