Jump to content
Xtreme .Net Talk

Nazdor

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Nazdor

  1. There should never be any need to sit and wait for something to happen. Instead, start that something and exit - and the end of the 'something' run the next step, eg (pseudo): Startup Form = frmSetup frmSetup_Unload (handles MyBase.Closed) Load frmMain or use Derek Stone's idea
  2. One suggestion - instead of using picture box arrays (I'm assuming), have a single picture box, get the graphics object from it and draw on it directly, using: graphics.DrawImage(... This allows you to specify the source, position and size So load each thumbnail into a memory bitmap and draw it directly onto your single preview picture box's image.
  3. You could also try one of the Bitmap constructors (.New), ie: Public Sub New(ByVal width As Integer, ByVal height As Integer, ByVal stride As Integer, ByVal format As System.Drawing.Imaging.PixelFormat, ByVal scan0 As IntPtr) Where scan0 is: The address of a stream of pixel data. Bit confusing terminology, it's not a Stream object, rather a location in memory for the pixel data (note that in your case this would already be converted from the RAW data)
  4. Suggestion: Draw the grid onto a separate in-memory bitmap (that you keep, so you only have to do it once) then draw the bitmap over the top of the existing image. Possibly use a colormatrix to set a transparent background colour.
  5. The problem can be summed up with the question: What makes a bitmap? The answer is that a bitmap contains (within the stream) a header record followed by pixel data. For full details, see: http://www.wotsit.org/search.asp?s=bmp When you contruct "a bitmap from a stream", the stream itself already contains the header and pixel - you don't "construct" as such - it's already constructed and you're just reading the details from the stream (same as you would from a file). In this case, you are not supplying a bitmap stream, nor a stream of bitmap data - you are supplying raw binary data (as noted in your most recent comment) What code are you using to convert from RAW file to a Bitmap? You could probably use very similar code, just without saving to disk first. But as far as your original statement, "Can someone help me to understand how a Bitmap which is constructed from a Stream gets its width and height?" goes - the stream must already contain all the information required, as it would if reading from a file. You may be able to do something with Image.RawFormat, but I suspect you already know how to do the conversion (which is the hard bit)
×
×
  • Create New...