zoukankan      html  css  js  c++  java
  • [转载]Converting a bitmap to a byte array

    出自 OceanChip http://www.cnblogs.com/Oceanchip/archive/2006/12/06/583758.html

    方法一:

    Code

    in most cases this works fine, because your bitmap doesn't have an alpha channel. But if it does, and you want to preserve it, then use Format32bppArgb in the fist line when locking the bitmap.
    I wish I could think of a way of doing this without locking the bitmap (ie, you could use GCHandle.Alloc() and then call Marshal.Copy() using the created handle, but the problem is I wouldnt know the size of the bitmap without locking it's bits and the Marshal.Copy() function needs to know the size).

    Code

    方法二:

    Code
  • 相关阅读:
    CF700E Cool Slogans
    [NOI2018]你的名字
    [CTSC2012]熟悉的文章
    CF666E Forensic Examination
    [BZOJ4310]跳蚤
    CF1063F String Journey
    [BZOJ3277]串/CF204E Little Elephant and Strings
    CF123D String
    使用ActiveReports for .net 进行报表开发之交叉报表(转)
    使用ActiveReport for .net 进行报表开发(一)(转自Cure The Last Day Of Summer)
  • 原文地址:https://www.cnblogs.com/mishy/p/1288185.html
Copyright © 2011-2022 走看看