Re: Loading image byte array



Hi Andreas,

Yes, the double memory is the tradeoff with using the built-in bitmap file
reader. We can hope that if the file format is compressed, the first bitmap
will be smaller than the second (the second is fully uncompressed). Also, if
you care about speed, I don't recommend PictureBox, but a Control-derived
class and paint a portion of the bitmap directly on that.

Regards,
Frank Hileman

"Andreas" <dont.need@xxxxxxx> wrote in message
news:upiGMkqRHHA.1860@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Frank, I actually got it working myself before I saw your code. I
load the my image like Michael Phillips suggested. Sure I'm currently
limited to BMP fileformat but that can be changed. Wouldnt your method
mean I would your method mean I would, for a moment, have two bitmaps at
the same time? If I use large images then this will eat memory for sure.

The one advantage with your method is that I will be able to use various
fileformats "out of the box" and don't need to make my own file format
parsers (BMP was easy, but I fear PNG; JPG and GIF can be a bit tricker).


"Frank Hileman" <frankhil@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> skrev i
meddelandet news:%23RIeYmlRHHA.4632@xxxxxxxxxxxxxxxxxxxxxxx
Load it first into a Bitmap as usual. You will know the width and height
at that point Then create a Graphics using a fast-access second bitmap
(we call it EffectBuffer), and render into that second bitmap using
DrawImageUnscaled. Dispose the first Bitmap.

Also I just posted some more information on the fast access technique in
the original thread.


.



Relevant Pages

  • Re: Right clicking to save an image, small problem.
    ... In microsoft.public.windows.inetexplorer.ie6.browser, "Basil" ... The save dialogue will not allow me to change the ... >file format as only bitmap is listed. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: PocketSignature saved in the SQL CE database
    ... If you are passing a byte array to a bitmap constructor, ... you will have to use bitmap file format. ... > If I insert an image file, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: PocketSignature saved in the SQL CE database
    ... image in the database, but it only saves a black image. ... Bitmap bmp = new Bitmap; ... I really need to be able to save the signature as an image or else...this ... > you will have to use bitmap file format. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How can I draw faster than .NET graphics?
    ... Does the framework load the file each time it draws?!? ... If you load the bitmap from a file ... second bitmap of the same size but Format32bppPArgb, ... object to draw the first bitmap onto the second and then dispose the first ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: How can I draw faster than .NET graphics?
    ... If you load the bitmap from a file I ... second bitmap of the same size but Format32bppPArgb, ... to draw the first bitmap onto the second and then dispose the first bitmap. ...
    (microsoft.public.dotnet.framework.drawing)