Jump to content

AndyH

Newbies
  • Posts

    1
  • Joined

  • Last visited

About AndyH

  • Birthday 01/01/1970

AndyH's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Hi, I'm new to graphics programming and I was curious on what method Paint.NET utilizes to render its graphics (the image, not user interface). I believe one of the following three alternatives to be the case. (1) You use GDI+ (e.Graphics.XX) to render the image onto a custom control (some sort of canvas). Possibly use transformations such as Transform (for zoom and panning) and ScaleTransform (zoom). (2) You interop with GDI and use APIs such as AlphaBlt / StretchBlt to render your graphics onto the surface of a canvas control. (3) Something completly else, like direct memory manipulation (pointers, memory copies and so on). I've tested (1) and it works well (easy and compact code) for resonable sized images but very slow on large images (such as 3000 x 3000 at 100mb or so). When I tested method (2) I managed to get a lot better performance and it was also easy and nice code (calles to AlphaBlt lets me both zoom and alter opacity). The closest I've gotten to (3) so far would be to use the overload of the Bitmap class which enables you to send in a pointer to a DIB (byte array). This has proven to be extremly fast while panning a huge image. The drawback is that I have to decode the image myself, i.e use stuff like BITMAPFILEHEADER structures and some memory copy to get to the DIB. Which in turn mean I would have to write my own encoders/decoders for all the image formats I would like to be able to process. Im experimenting with some code to manipulate large/huge images and I'm looking for the BEST possible way to get performance in my rendering / zoom techniques and some pointers woule be very helpfull Thanks and keep up the good work!
×
×
  • Create New...