|
Thanks, that was the problem
now I can download the 2.5MB file in about 13 seconds
anyway I would like to know what I did wrong with the download in parts (just to learn for the next time) but its not that urgent anymore.
Thank you very much
|
|
|
|
|
Hello Everybody,
I am drawing text, rectangle and Line. In which have i am tring to zoom Text but i m confused how to zoom text as per as zoom level.
Eg : Rectangle r = new Rectangle (x,y,width * zoomlevel,height * zoomlevel);
How to Zoom Text for ZoomLevel.
Thanks
If you can think then I Can.
|
|
|
|
|
You need to create a scaled version of the text's font.
|
|
|
|
|
The easiest way to do this is very simple: apply a Scaling factor to the graphics object you are drawing on. Create a Panel, and two buttons, then handle the appropriate events:
float sx = 1.0F;
float sy = 1.0F;
Font font = new Font("Verdana", 10.0F);
private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.ScaleTransform(sx, sy);
g.DrawRectangle(Pens.Blue, new Rectangle(50,50,150, 150));
g.DrawLine(Pens.Red, 0,0, 200,200);
g.DrawString("Hello there this is text", font, Brushes.Green, new Point(20,20));
}
private void butZoomIn_Click(object sender, EventArgs e)
{
sx *= 2;
sy *= 2;
panel1.Invalidate();
}
private void butZoomOut_Click(object sender, EventArgs e)
{
sx /= 2;
sy /= 2;
panel1.Invalidate();
}
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Oh, good call, I forgot about that.
|
|
|
|
|
Good Day all
i have a SQL Job and i want to change the times in the job programmatically from C#. The application that will change the Job Settings will be accessing the job remotely.
Is is possible ?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Just curious, same question you asked here[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
Yes you are right, this is because i want to see different types of View from different type of People. its not like i posted the same question in the same website.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Vuyiswa Maseko wrote: its not like i posted the same question in the same website.
Yes, I agree.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
You mean when it is scheduled to run?
Are you writing a SQL management tool? If not I don't see the point.
The point of having a scheduled job is to schedule it because it isn't dynamic (relatively speaking). And there are other ways to deal with dynamic problems.
I am rather certain you can create jobs via some API though. That would include setting the times. I would google for it.
|
|
|
|
|
Hi all,
i want to develop one addin for MS Word. document created under my addin can not open without my addin(i.e. if user don't have my addin, default screen to download addin will open....after install user can view the document). is it possible with Word addin? how?
Thanks,
Ankur
!- F - R - I - E - N - D - S -!
|
|
|
|
|
I would start by defining a new file extension for documents created with my add-in. When Windows encounters an unknown file type, it asks the user to identify an application to use for opening it, or offers to search the Web for a suitable application. Your download site will have to publish its ability to provide a suitable program for opening that type of file, and I have no idea how that is done, but I'm sure you can find that information using Google.
Will Rogers never met me.
|
|
|
|
|
Dear sir
Myself Pardeep working in the private sector. I am beginer in the C# environment. I got a task to stich(join) two images with removing overlap area one of the image. First i am tried a lot for loading two images in c#. I did't get any desirable help. please help me.I am waiting for your feedback.
Thank you.
|
|
|
|
|
I guess you need to start with the Image [^] Class.
The best things in life are not things.
|
|
|
|
|
- Load the two images with Image.Load
- Calculate or take as user input the overlap amount/direction
- Create a new Bitmap* for the combined image, taking into account the overlap when calculating the size
- Get the graphics object for the new bitmap (Graphics.FromImage, iirc)
- Draw the first two images into the combined bitmap with Graphics.DrawImage
*: unless you're combining metafiles or another vector format, but 'image' usually implies raster.
|
|
|
|
|
helo guys... I am frequently wathcing the following line in tutorials online. What does this line mean? thnx
public int? Year;
|
|
|
|
|
int is non nullable
int? is nullable
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
to elaborate on Mycroft's reply. This is often used when talking to the database. Suppose you have a column that contains a number, but the column can be null. In that case you would need to check if the value was DBNUll.Value and if so convert your variable (that maps to that column) to -1 or 0 or something. When using the ? construct you don't need to convert it and can directly map the variable to the database column. Some goes if you want to write a value to that column.
The ? is an 'override' so you can put null values in non-nullable variables (int, double, DateTime, ... but not strings, they can be null)
Hope this helps.
[EDIT]PS: don't be afraid to use it, but don't use it if you don't have to.[\EDIT]
V.
|
|
|
|
|
The ? after the variable type renders a variable that is nullable. What value that may have I haven't discovered, as I like my variables to have real values before I use them, but apparently someone has decided that a null integer is a good thing, and thoughtfully provided a way to declare such a beast. The ? operator can be used with any type, for what it's worth.
Will Rogers never met me.
|
|
|
|
|
Roger Wright wrote: The ? operator can be used with any type, for what it's worth.
No. It can only be used with value types (int, double, decimal, DateTime). It cannot be used with reference types. And it cannot be used with strings.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
Part of the reason it can't be used with strings is that strings are nullable by default. They don't need special treatment.
|
|
|
|
|
I just checked, cause I wasn't sure... string is just a reference type, that acts like value type. So it can point to a null reference of course. My mistake
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
I didn't know about the reference type limitation, but then, I can't think of any value for the concept anyway and have never needed it. Strings are nullable by nature, so they don't count. Thanks for the info!
Will Rogers never met me.
|
|
|
|
|
? can be useful to determine if a choice has been made. To give an example, a person has 0 children because
1. they truely don't have any children or because
2. The value was never set?
Null is a way of explicitly determining if the person has no children. The old way was to set the default to -1. I think null is a better way of expressing that the value was not set.
"You get that on the big jobs."
|
|
|
|
|
To expand on the last reply, it is useful when a variable can validly take the whole range of the type in question, and can also have a 'not set' value. Typically we have either used an invalid value (e.g. testing getchar() for -1 in old school C; -1 is a common 'not set' value in ints still) or created another boolean variable to define whether or not we set a value:
bool customerLikedProduct;
bool customerResponded;
People have also solved that one with a three way enum ...
enum NullableBool { True, False, Maybe }
... but when you do that you lose the ability to use boolean logical operators, compatibility with external data sources or applications, etc.
In these cases, you would like to be able to represent the 'not set' value within one variable. That's what nullable types give you:
bool? customerLikedProduct;
As already mentioned, it's particularly useful for working with databases where null values are a common and standard thing.
For me, using -1 or double.NaN is fine, as long as that can never be a valid value for the variable in question. But there are times when the whole valid range for the natural data type is valid and you should use nullable types.
|
|
|
|