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
A

Aaron Schaefer

@Aaron Schaefer
About
Posts
163
Topics
78
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Delaunay Triangulation in c#
    A Aaron Schaefer

    Wondering if anyone would be interested in an article on triangulation of irregularly spaced data in c#? There are some good articles on this site in c++, but I haven't seen one for c# yet.

    Article Writing csharp c++ question

  • Computational Geometry Text
    A Aaron Schaefer

    Anybody care to recommend a good reference for Computational Geomtetry Textbook? Anyone familiar with "Computational Geometry in C", from the Cambridge Press? Just starting to do a little work in the subject, and would like to find something to help with triangulating some vertices for visualization of data. Thanks, Aaron

    The Lounge help question

  • Drawing in background thread
    A Aaron Schaefer

    That one runs on the main thread. The handler for the DoWork event runs in the worker thread. Aaron

    Graphics graphics help tutorial question announcement

  • Drawing in background thread
    A Aaron Schaefer

    You're right, I wan't paying attention there. Updated code looks like this: void worker_DoWork(object sender, DoWorkEventArgs e) { int width = (int)Math.Round(Width * fDPIX); int height = LogHeightPixels; Bitmap bmpNew = new Bitmap(width, height/*, System.Drawing.Imaging.PixelFormat.Gdi/*.Format32bppArgb*/); DrawLogToBitmap(bmpNew); e.Result = bmpNew; } void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { Bitmap bmpNew = (Bitmap)e.Result; if (bmp != null) { bmp.Dispose(); bmp = null; } bmp = bmpNew; Refresh(); } Refresh ends up calling my Draw method here: public override void Draw(Graphics gfx, Rectangle rect) { gfx.ScaleTransform(zoom, zoom); // Update the bitmap (only as needed) if (bDirty) { UpdateBitmap(gfx); } if (bmp == null || worker.IsBusy) { gfx.DrawString("Updating Bitmap, please wait!", this.Font, Brushes.Black, new PointF(0, 0)); return; } RectangleF rcSource = new RectangleF(-horizontalOffset, -verticalOffset, ClientRectangle.Width/zoom, ClientRectangle.Height/zoom); RectangleF rcDest = new RectangleF(ClientRectangle.Location.X, ClientRectangle.Location.Y, ClientRectangle.Size.Width/zoom, ClientRectangle.Size.Height/zoom); try { gfx.DrawImage(bmp, rcDest, rcSource, GraphicsUnit.Pixel); } catch (Exception exc) { gfx.DrawString(exc.Message, Font, Brushes.Black, new PointF(0,0)); } etc.... } Now, the bitmap seems OK, but I get an out of memory exception when I call DrawImage (hence the try/catch block). Using the exact same drawing code in the main thread causes no problems, even though it's a pretty big bitmap (2496 * 49152 * 32 bpp). If I try using a bitmapp with a different pixel format, say 16bpp to conserve memory, performance becomes terrible, but I don't get the exception.

    Graphics graphics help tutorial question announcement

  • Drawing in background thread
    A Aaron Schaefer

    Help! I'm working on a control that does a fair amount of work to render itself. I've got it set up where it basically does all of its drawing to a bitmap that it holds on to, and then in the Paint method just copies the data from the bitmap to the client area, depdning on how much of it is currently visible, zoom factor, etc. Certain operations by the user can cause this bitmap to need to be redrawn. This is a time consuming operation (might take 5-10 seconds), and I'd like to update the bitmap in a worker thread, so that the app doesn't freeze while its doing its rendering. Anyone know how to go about this? I created a BackgroundWorker, as follows: I initialize the worker here: worker = new BackgroundWorker(); worker.WorkerReportsProgress = false; worker.WorkerSupportsCancellation = false; worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); worker.DoWork += new DoWorkEventHandler(worker_DoWork); Then, if my bitmap needs to be redrawn, I start it here: worker.RunWorkerAsync(); void worker_DoWork(object sender, DoWorkEventArgs e) { // Create a new bitmap for the log int width = (int)Math.Round(Width * fDPIX); int height = LogHeightPixels; bmp = new Bitmap(width, height); DrawLogToBitmap(bmp); e.Result = bmp; } void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { Bitmap bmpNew = (Bitmap)e.Result; if (bmp != null) { bmp.Dispose(); bmp = null; } bmp = bmpNew; } In the DoWork handler, I create a new bitmap, do the drawing, and then assign the bitmap to the Result parameter in the RunWorkerCompletedEventArgs. It looks fine here, but then I get back to the main thread (in the RunWorkerCompleted) and the bitmap looks like garbage there. Any ideas what I might be doing wrong? Thanks In Advance, Aaron

    Graphics graphics help tutorial question announcement

  • Software Recommendation
    A Aaron Schaefer

    Thanks! I'll check out the sites you mentioned. Aaron

    The Lounge sysadmin question announcement

  • Software Recommendation
    A Aaron Schaefer

    Hey Folks, I was wondering if anyone has had any experience with software registration services? My company has developed a product we would like to distribute trial version of, and allow users to register the product after the trial period. We don't really have the resources to set this up in house (registration server, etc.) so I am looking for a turn key type of solution that I can just drop into my product. Anyone have experience with any registration services that could recommend a couple of sites to look at? Thanks, Aaron

    The Lounge sysadmin question announcement

  • Licensing Component
    A Aaron Schaefer

    Hi All, I have a product which I am planning on distributing to a few Beta testers. I thought it would be a good idea to incorporate some sort of licensing/registration scheme for it, so I can control it, have a trial version that expires after a certain period of time, etc. Does anyone have any experience with licensing solutions that can be used with .NET components? Thanks, Aaron

    C# csharp beta-testing question announcement

  • Help - Serialization Problem
    A Aaron Schaefer

    Hi ALl, I have developed a control library, and am running into some problems with serialization. When trying to serialize one of my controls, the serializer complains when it runs into something like the following: [Serializable] public class Control { public ContextMenu {get{...} set{...}} } So, the ContextMenu class is not serializable. If I try something like this: [Serializable] public class Control { [NonSerialized] public ContextMenu {get{...} set{...}} } I will get another error that the NonSerialized attribute is only for fields or something. Apparently this only works for simple types, ie int's, strings? Is there another attribute to tell it to ignore a certain property when serializing? Thanks in advance

    C# help json question

  • Book Recommendations
    A Aaron Schaefer

    Hi All, I've recently tackled a project that involves a little bit of DirectX in managed code (c# with the June 06 DirectX SDK). I'm wondering if anyone has any recommendations for a good DirectX book? Something that focuses on managed DirectX, for someone who is comfortable programming in c# (a lot of the DirectX related stuff is sort of geared to people with very little development background). Just wondering if anyone here has run across a good reference that they would recommend. Thanks, Aaron

    C# csharp graphics game-dev question learning

  • PDF Creation in C#
    A Aaron Schaefer

    Hello All, I was wondering if anybody had any experience with PDF creation in c#. I am working on a project where we have had a request to add the ability to export the output of our project (basic 2d line plots, graphics, text) to a PDF. I have seen a number of 3rd party components that advertise being able to create PDF's, and I suppose Adobe has something as well. The general price range seems to be about $100, which I don't mind paying for something that works and is easy to use. I am not trying to convert anything into a PDF (some packages seem to be advertising this feature), but create the PDF directly, and populate it with some graphics. Anything out there that exposes a Graphics object that represents a PDF page that I could just draw to with the code I already have in place for printing? Any advice? Thanks! Aaron

    C# csharp graphics adobe question lounge

  • Grid Control recommendations
    A Aaron Schaefer

    So far it looks really nice. I have no need for heirarchical data, but I do need some flexibility as far as the types of controls, styles in the grid, etc. SO far, I've been pretty disappointed in the commercial offerings and the lack of flexibility. I can see there's a little bit of a learning curve with it, but can tell the developers went to a lot of trouble to build in a great amount of extensibility.

    C# csharp css question

  • Grid Control recommendations
    A Aaron Schaefer

    Hey, Thanks for the tip. This looks a heck of a lot better than the one we paid $500 to use. I suppose it's OK to use this in commercial software?

    C# csharp css question

  • Grid Control recommendations
    A Aaron Schaefer

    Hi All, Wondering if anyone has a good recommendation for a c# grid control? Looking for something that allows for "virtual grid" type of thing. I've tried ComponentOne, and wasn't crazy about theirs (too hard to customize). Anybody used one that they have been happy with?

    C# csharp css question

  • Implementing Backups
    A Aaron Schaefer

    Thanks, you're right, I do need to get backed up ASAP. I could probably present a pretty strong case for a tape backup for the machine, but I don't really know how much they cost, what to look for etc. What's a good tape backup run?

    The Lounge question csharp database sysadmin collaboration

  • Implementing Backups
    A Aaron Schaefer

    Hi All, I've just configured a machine on out network to act as a build machine, and installed SVN, CruiseControl.NET, and Bugzilla. I'm at the point where I need to start backing up the machine, so I don't lose the stuff on it, but I'm not really sure what the best options are. At the very least, I would like to make an image of the machine itself, (probably need about 10G), then backup the SVN repository, Bugzilla database, CruiseControl folder, etc (don't need much room for these, maybe a couple hundred MB). I would like the source code backups to be automatic, and pretty regular, maybe nightly or weekly. The worst thing that could happen would be to lose the SVN repository. So far, I can think of these options: A) Backup to DVD-RW. The machine has a DVD-RW drive on it. Pretty cheap, but what is the life expectancy of DVD-R media? I've heard this might not be as reliable as a tape backup. B) Tape backup. More expensive, I would have to buy a tape backup. C) Web backup. I've heard of places where you upload your stuff, and they charge by the MB. Thanks, Aaron

    The Lounge question csharp database sysadmin collaboration

  • Open Source Bug Tracking?
    A Aaron Schaefer

    So many choices . . . I'm not even sure really what I should be looking for when comparing one against the other. Bugzilla does have a cool tshirt, though . . .

    The Lounge collaboration help question workspace csharp

  • Open Source Bug Tracking?
    A Aaron Schaefer

    Hey All, A while back I posted a question about open source version control software. I got a lot of great feedback, thanks for all the good responses. Our workflow now includes SVN for version control (with Tortoise SVN on the client side), MSBuild for building stuff, and CruiseControl.net for Continuous integration (still working on getting the last two set up). We are currently using Outlook for issue tracking, ie lots of emails back and forth, etc. I notice things tend to get lost easily this way. Surely, someone has had some experience with a simple open source/free issue stracking setup. Just looking for something basica that will allow us to track issues, assign priorities, assign a developer to an issue, etc. Anybody have suggestions? Thanks! Aaron

    The Lounge collaboration help question workspace csharp

  • Trendlines
    A Aaron Schaefer

    You might try this reference. The price is right anyway. I bought the hardcover (for about $4 plus shipping, I think), but the full text is available online here: http://www.library.cornell.edu/nr/bookcpdf.html[^] Good luck! Aaron

    The Lounge

  • Source Control Recommendation
    A Aaron Schaefer

    Hey, this is exactly the kin of info I was looking for. Thanks for the excellent response. Aaron

    The Lounge question
  • Login

  • Don't have an account? Register

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