Extensions/ImageGlass.Core/BitmapBooster.cs
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
namespace ImageGlass.Core
{
public class BitmapBooster
{
Bitmap src;
BitmapData bd;
IntPtr dst;
int str;
public BitmapBooster(Bitmap src)
{
this.src = src;
bd = src.LockBits(
new Rectangle(Point.Empty, src.Size),
ImageLockMode.ReadWrite,
PixelFormat.Format32bppArgb);
dst = bd.Scan0;
str = bd.Stride;
}
public void Dispose()
{
src.UnlockBits(bd);
}
public Color Get(int x, int y)
{
unsafe
{
byte* o = (byte*)dst;
int ofs = str * y + x * 4;
return Color.FromArgb(
o[ofs + 3],
o[ofs + 2],
o[ofs + 1],
o[ofs + 0]);
}
}
public void Set(int x, int y, Color c)
{
unsafe
{
byte* o = (byte*)dst;
int ofs = str * y + x * 4;
o[ofs + 3] = c.A;
o[ofs + 2] = c.R;
o[ofs + 1] = c.G;
o[ofs + 0] = c.B;
}
}
public void Set(int x, int y, byte alpha)
{
后面还有 26 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。