Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JDUK

@JDUK
About
Posts
19
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Best way to store user pref's
    J JDUK

    Whats the "best" (most widley accepted) way to store user preferences in a way they can be read and written to? I though of using .config and coding a way to write back to it .... but have since been told its bad programming practice to write to a .config. May be the registry? but im using this program as a peice of portfolio work to show potential employers and im not sure they would want a slew of candidates code writing to somthing as volotile and not-so easily cleaned as the reg' .... or is this somthing they will expect?

    C# windows-admin question

  • Imaging Application - not enough RAM
    J JDUK

    Make sure you dispose of absolultey every thing the moment you have writen it to the screen. If you write a bitmap to screen... dispose of it. if you draw a line dispose of the pen and/or brush and the graphics object as soon as you have drawn it. Dont think because its on screen you should not dispose of it until you no longer need it on screen... draw it then dispose of every graphics element(Bitmaps, clones, pens, brushes, graphics objects) it used. I wrote a simple app that used cloned portions of a bitmap as brushes and painted them to the screen... i didnt get many brushstokes done before i hit an "Out of memmory" error when depending soley on the GC.

    C# csharp performance help tutorial

  • GDI+ flicker when drawing to a panel
    J JDUK

    Yeah sorry about that... I hate it when I search for a problem and the OP says "sorted" and it just dies right then and there, to. So here goes: My Drawing function looked like this(Though it has been drasticly cut down to the bare minimum for readability): private void DrawMyStuff() { System.Drawing.Graphics myGraphics; myGraphics = myPanel.CreateGraphics(); MyGraphics.DrawImage(myBitmap, x*Size,y*Size); MyGraphics.Dispose(); } My panels paint method looked like this private void myPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { DrawMyStuff(); } I have since changed it to look like this: private void DrawMyStuff(Graphics g) { g.DrawImage(myBitmap, x, y); g.Dispose(); } & private void myPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { DrawMyStuff(e.Graphics); } I think my problem was re-assigning the graphics object every time and in a way bybassing the double buffering by recreating the drawing surface constantly. Hope that helps some people...

    C# graphics question winforms

  • GDI+ flicker when drawing to a panel
    J JDUK

    This problem has been plauging me for weeks.... then a minuite i post this i stubmle across the solution (more by luck than judgment) .. sods law, hey? All sorted now thanks. :D

    C# graphics question winforms

  • GDI+ flicker when drawing to a panel
    J JDUK

    I have a panel inside a form im drawing to becuase the drawing space needs to be bigger than the form and the user needs to be able to scroll round the image using the form scroll bars.. i have used SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); to try and stop the flicker but it only works when the form itself is drawn to. How do i get double buffering to work on the panel? Thanks.

    C# graphics question winforms

  • Game Programming
    J JDUK

    No comercial games? try what about?: http://arenawars.krawall.de/eng/ And the only reasons not many comecial games are written in C# is: 1) the VAST majority of games dev tallent is in C++ ...any move over to C# is going to be a slow process as a games dev's time is strongly dictated by deadlines so time out to learn C# is not easy to come by. 2) The prodution cycle for most games is longer than Managaed DX has been a viable alternative for so no wounder they're arn't many commerical games in C# about :? There is no reason commercial games can not be made in C# with managed DX9 unless you really need to hit up as much power as is possible (that 2% you loose from using managed code) and you are able to use unmanaged code to squeeze it out of a system.... but not every game (or even, every 10th game) needs that raw power and if im not mistaken there is a 3D engine written in C# that belts along faster than its C++ coded version (cant remember the name check out gamedev.net for info). So to the OP dont abandon C# for games devving, you will get results much faster than a simular project in C++ and it will help keep motivation up ... and no one will be able to tell any difference between your games and games written C++... accept your games will be finished long before the same thing could be coded in C++. As a non-pro, C#'s managed nature will help you avoid many a pitfall you could stumble in C++ that could cause slowdown or performance issues... so from an amatures point of view you will probably find your games run better if written in c# than they would if you wrote them in c++ as C# will be handling a lot of the stuff that may cause problems for you. read around, get oppinions from games dev sites, C# is as viable as C++ right now and there is no reason to be struggling with C++ when C# is sutch a cake walk to code.... Ok you wont get a professional games dev' job right now with C# right now but i saw UbiSoft advertising for .Net coders to write games development tools earlier this year, so its only a matter of time before more games dev' houses take up C#.

    C# csharp graphics game-dev help tutorial

  • GDI+ doublebuffering isnt stopping flicker :(
    J JDUK

    Thanks guys tried both of those and no joy :(

    C# graphics winforms game-dev data-structures performance

  • GDI+ doublebuffering isnt stopping flicker :(
    J JDUK

    I have added this lines as recormended to InitializeComponent() this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint,true); What i am doing is reading an array in memory with a reference to locations on an image. I then draw the source image to a bitmap then clone the needed area(described in the array element) to a second bitmap then draw that to a onto a panel on a form. The program is a graphical level editor for a 2D tile engine based game and it works fine except when i scroll around the level editor window the image redraw looks horrible even with the double buffering enabled. Any advice? Thanks in advance, James.

    C# graphics winforms game-dev data-structures performance

  • Whats a good crossplatform C#/.Net book?
    J JDUK

    I've been looking at 3 books as im currentlty intrested in learning how to make crossplatform .NET aplications that run on Linux: Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET http://www.amazon.co.uk/exec/obidos/ASIN/1590593308/ref=cm\_mp\_wli\_/202-5494928-0984624 Mono: A Developer's Notebook http://www.amazon.co.uk/exec/obidos/ASIN/0596007922/ref=cm\_mp\_wli\_/202-5494928-0984624 Mono Kick Start http://www.amazon.co.uk/exec/obidos/ASIN/0672325799/ref=cm\_mp\_wli\_/202-5494928-0984624 Has any one read or heardanything about these books and able to recormend anyof them or any other books on the subject of crossplatform .NET applicatios? Thanks.

    C# csharp learning linux tutorial question

  • How do i clear all error providers in one command?
    J JDUK

    I have a form the user fills in and if any of the key fields are missing they show the CrucialDataMissingError errorprovider i created. BUT the user has the option to continue without entering all the key data fields. So i need a way to set all CrucialDataMissingError's to "" if the user chooses to ignore the errors is it possible to do this with a single command for all error providers of the same type or do i need to do each in a seperate command. Thanks.

    C# question help

  • Can you create instances named at runtime?
    J JDUK

    I want to create an instance of a class, the instance being named by the user at runtime. So i can put that instance in an arraylist and refer to it by name later (for removing and searching purposes). Is this possible?(& how?) or am i better off just cycling through the arraylist and searching for the significant identifier in each record. (in this case the Student Number) Thank you.

    C# algorithms question

  • Animating .x files with MDX9
    J JDUK

    Having looked through the C++ samples on the DX9 SDK it seems what im after is a C# version of the MultiAnimation demo. (the one where you add models to a scene then they move around firing off different animations like walk, run, loiter, wave etc) Any one know of a link to any thing like this? Thanks

    C# tutorial question learning

  • Animating .x files with MDX9
    J JDUK

    Yes the example shows you how to make an animation loop from a.x file with only 1 animation in it. It doesnt really stop and say: "if you only want to play frames x to y do this" or "If you want to play animations X or y do this" Ihave yet to re-read it and impliment the code (i read it once and browse the source code then re-read and do it my self) but from what i've read it basicaly just plays the animation in a loop... What would have been handy is if the book used a model with more animations as an example and showed you how to activate each one indervidualy .eg press W to start walk animation. C to srart crouching J to start jumping..... would be a much more apt example of how to use mesh animaiton in games.or maybe im asking to much :)

    C# tutorial question learning

  • Animating .x files with MDX9
    J JDUK

    IIRC, keep reading. Nope scanned ahead and 13 is the last chapter covering 3D... after that its sound, 2d graphics, user input and networking then the back cover. :( I cant find an example in the SDK either that shows how to pull various animations out of a .x file :( any clue as to which one i should be looking at?

    C# tutorial question learning

  • Animating .x files with MDX9
    J JDUK

    I've just read through the 1st 13 chapters of Tom Millers MDX9 book. The examples given basicly leave you with a single looping animation from a .x file. Are there tutorials or guides out there on how to get a better level of interaciton with the .x animation? For example a way to play different animations on a key press or only play a certain amount of frames from the .x file? Thanks

    C# tutorial question learning

  • User clicks on dataGrid....
    J JDUK

    If a user clicks on a cell in a dataGrid is there any way to return the row number of the cell they clicked (or double clicked) on? Thanks.

    C# question

  • ComboBoxes & DataTables
    J JDUK

    Ok i have a DataTable that has 2 columns: ID & Name I have populated a combo box from that data table like so ComboBox1.DataSource = XmlIn.Tables["Names"]; ComboBox1.DisplayMember = "Name"; Now when a user selects a name from the combobox and then clicks a button i need away to return the coresponding ID to that name. I have thought of using a DataView to scan for the name and return the relevent number but was sure there was a tidier way to return the ID value. Can any one help? Thank you.

    C# help question

  • Ho do i connect to an XML file using C#.net?
    J JDUK

    Can you give me an example of how i would perform a select on a DataSet please? The only methods i have read in the book involve using the SqlConnection i.e string MyCom ="SELECT * WHERE id = 001" SqlCommand MySqlCom = SQLCONNECTION.CreateCommand(); MySqlCom.CommanText = MyCom; etc... As you can see doing that requires you to refference the SqlConnection. So having no connection means i couldnt select in this way (and its the only way i have used up to now). Also the Access files i have been using are not servers either but you can ad them through server explorer ??

    Database csharp database question sql-server sysadmin

  • Ho do i connect to an XML file using C#.net?
    J JDUK

    I dont have SQL server, just an XML file on my hard drive. How do i use Server Explorer to build aconnection to that XML file? I can, so far, load the file into a dataset using: DataSet MDS = new DataSet(); MDS.ReadXml("C:\\Students.xml"); But this doesnt allow for manipulaiton e.g: SELECT, DELETE, INSERT INTO, etc.... Does it?? I've had a bash conecting to an Access database and mangaed to manipulate it and do every thing i need to really.... But i need to be able to do this with an XML file and the informaiton in : Developing Windows Based Applictions seems a bit thin with regards connecting to and altering XML files. Thanks

    Database csharp database question sql-server sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups