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
  • 相关阅读:
    jq 换图片路径
    sql 把一列的数据按逗号分隔转换成多行
    sql 数据库查看主外键关联
    sql 表连接 join
    sql 查看 锁定的表 或者 未提交 的事务
    WMI技术介绍和应用——查询硬件信息
    System.Web.HttpContext.Current.Server.MapPath("~/upload/SH") 未将对象引用设置为实例对象
    sql server output用法说明
    merge into 的用法
    JAVA Stop The World 第八节
  • 原文地址:https://www.cnblogs.com/mishy/p/1288185.html
Copyright © 2011-2022 走看看