|
You guys are terrible.
I think I will let him take my picture though. Now my dumb questions don't make me feel so bad.
|
|
|
|
|
help me in downloading source code
|
|
|
|
|
1) Source code for what
2) What is the original problem?
|
|
|
|
|
attendance management system
|
|
|
|
|
I think you're in the wrong place. You want someone to write you an attendance management system? These forums aren't for that. They are for "how to" questions, not full solutions. Otherwise these posters would never get paid for their work.
|
|
|
|
|
This[^] might help.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Sure:
Click the link. When the download dialog appears, you choose "Save". Then you select a target folder on your system and click ok.
Do you also need to know how you locate and open the file after download has completed?
|
|
|
|
|
You need to provide more details to what you are trying to do.
My signature "sucks" today
|
|
|
|
|
What's to understand? His question is to blatently leech code off of someone else and turn it in as his own work.
|
|
|
|
|
Hi,
i am making a small image viewer application by using C#. I created a user control which will take the image input and draw it by using the override method OnPaint, and then add the control into the flowlayoutpanel. In FlowLayoutPanel, i set the autoscroll = true. Everything works fine, except when i scroll down the panel, the images become vague and the program has to repaint them. Please look at the screenshot for more details
http://i979.photobucket.com/albums/ae280/jasonvoorheeszzz/bug.png[^]
Have anyone got the suggestion to fix it?
|
|
|
|
|
maybe you are running out of memory somehow.
are those basically large pictures drawn at a very small scale? if so, you should create smaller versions, and use those to do your painting.
we'll need more information, some numbers and some code to offer actual help.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thank you for replying me. I dont think this is the problem of the memory usage coz i checked it carefully.
This is the code my ImageArea class (user control):
public Image LoadImage()
{
Image tmpImage = Image.FromFile(imageName);
Bitmap tmpBitmap = new Bitmap(100, 100);
Graphics graphics = Graphics.FromImage((Image)tmpBitmap);
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
graphics.DrawImage(tmpImage, 0, 0, 100, 100);
tmpImage.Dispose();
graphics.Dispose();
return (Image)tmpBitmap;
}
protected override void OnPaint(PaintEventArgs e)
{
Image tmpImage = LoadImage ();
Graphics graphics = e.Graphics;
graphics.DrawImage(tmpImage, 0, 0);
tmpImage.Dispose();
graphics.Dispose();
}
When i press the button ok in the openFileDialog, it will run the AddImageArea function to add the control to the flowLayoutPanel
And this is the code of AddImageArea
public ImageArea AddImageArea(string filename)
{
ImageArea pbObj = new ImageArea();
pbObj.ImageName = filename;
pbObj.Width = 100;
pbObj.Height = 100;
pbObj.ImageName = filename;
pbObj.BorderStyle = BorderStyle.FixedSingle;
return pbObj;
}
|
|
|
|
|
bubuzzz wrote: graphics.Dispose();
that is wrong.
You should dispose of those objects that offer a Dispose() method if you created them (by calling new, or a method with "Create" in the name). you should not dispose of objects others created, such as the Graphics you borrowed from PaintEventArgs.
bubuzzz wrote: return (Image)tmpBitmap;
is OK, however IMO you don't need the cast.
One bad thing is you are loading and resizing all those images inside OnPaint(); OnPaint() should be fast (most of the time), so you would do better by keeping the small images in memory, maybe in a Dictionary (filename, smallImage), which you could load beforehand, or when necessary, but not every time the system decides it has to (re)paint.
Warning: Dictionaries tend to grow all the time, depending on the nature of your app, you may want to take care of that.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi all,
One System having Oracle database with RH Linux OS. in one more system having WinXP OS.
I want to access Oracle database through WinXP System.
How can I achive this?
|
|
|
|
|
by magic... you need to make a magic incantation on oracle database with one of the magic stick (C#, Java, C++, etc) or with one of Oracle's free IDE (e.g. SQLdeveloper)... then you will be able to for feel you're destiny!!!
|
|
|
|
|
In the code how can we check for below errors
i) DB files not available
ii) DB is corrupted
iii) Driver errors.
|
|
|
|
|
Just try to access it and display an the Exception.Message if one is thrown -- what else would you try to do?
|
|
|
|
|
Hi Experts,
What i am trying to achieve here is a bit tricky. Let me brief on a little background first before going ahead.
I am aware that we can use a enum as a type to a parameter of a method. For example I can do something like this (a very basic example)
namespace Test
{
class DefineEnums
{
public enum MyEnum
{
value1 = 0,
value2 = 1
}
}
class UseEnums
{
public void UseDefinedEnums(DefineEnums.MyEnum _enum)
{
}
public void Test()
{
UseDefinedEnums(DefineEnums.MyEnum.value1);
}
}
}
What i need to do is create a dynamic Enum and use that as type in place of DefineEnums.MyEnum mentioned above.
I tried the following.
1. Used a method which i got from the net to create a dynamic enum from a list of strings. And created a static class which i can use.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Test
{
public static class DynamicEnum
{
public static Enum finished;
static List<string> _lst = new List<string>();
static DynamicEnum()
{
_lst.Add("value1");
_lst.Add("value2");
finished = CreateDynamicEnum(_lst);
}
public static Enum CreateDynamicEnum(List<string> _list)
{
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(
aName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
int i = 0;
foreach (string item in _list)
{
eb.DefineLiteral(item, i);
i++;
}
return (Enum)Activator.CreateInstance(eb.CreateType());
}
}
}
2. Tried using the class but i am unable to find the "finished" enum defined above. i.e. I am not able to do the following
public static void TestDynEnum(Test.DynamicEnum.finished _finished)
{
}
I guess the post has become too long but i hope i have made it quite clear.
Why i need such a functionality?
I can very well make the method with string as a parameter. I need this so that the developer who is using the method need not have to remember the set of values, amongst which only 1 he should pass. He will directly get it through the enum which is being created dynamically.
Anyone Please help!
Thanks in advance!
Regards,
Samar
|
|
|
|
|
Hi Experts,
Any suggestions on this??
Regards,
Samar
|
|
|
|
|
Will generics solve the problem?
|
|
|
|
|
Any time you get some weird code from somewhere the best place to get answers when it doesn't work is to ask in the same place you got the code.
I don't really understand your goal. If your developers can't be relied upon to remember simple things then expecting them to use things like dynamic enums is probably a bad idea. Maybe if you gave an example of how it would be used we could give you an alternative. If the enum isn't built until runtime I don't see how it can give any advantage to someone at coding time.
|
|
|
|
|
Good day one and all,
I've been given a little task to create a petrol station app. The app allows for multiple "pumps" with the option of adding more petrol/gas pumps where required. Currently my app displays only one pump at a time and you change between pumps with a combo box.
Obviously in the real world you can have multiple pumps all running concurrently, so I wanted to duplicate the same form everytime a new pump class was created/instantiated.
Does anyone have a pointer on the simplest way for me to do this? A pointer to some code to look at would be ideal as I'm no coding guru at the moment.
Thanks all,
Mike.
|
|
|
|
|
Have you tried:
MyPumpForm newPump = new MyPumpForm();
newPump.Show();
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Cheers matey, that's getting me somewhere. I didn't think it would be quite that simple...
|
|
|
|
|
A problem with this is that if I close the first form that opens, it closes all subsequent ones.
|
|
|
|