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
  • 相关阅读:
    handlebars.js 模板引擎
    g2-plugin-slider.js 数据滚动条插件
    js拓扑图-vis插件
    js地图-leaflet
    css3 animation动画停留在最后一帧
    input输入手机号增加空格
    百度输入框 获取焦点时 滚动到页面顶部的实现
    C#入门经典-第15章Windows 编程
    C# 经典入门12章-System.Collections.Generic命名空间
    C# 经典入门12章-使用泛型-1
  • 原文地址:https://www.cnblogs.com/mishy/p/1288185.html
Copyright © 2011-2022 走看看