首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏林德熙的博客

    SharpDx D3D9 的颜色 Format 和 WPF 的 PixelFormat 转换方法

    本文告诉大家在 DirectX 9 的颜色格式 Format 和 WPF 的 PixelFormat 转换方法 转换代码如下 private static PixelFormat TranslateFormatToPixelFormat NotSupportedException(), }; } 值得一说的是 SharpDx 当前官方不维护了,可以选择的代替请看 SharpDx 的代替项目 在 WPF 的 PixelFormat

    58720编辑于 2021-12-27
  • 来自专栏音视频开发技术

    ffplay源码分析5-图像格式转换

    }, { AV_PIX_FMT_RGB444, SDL_PIXELFORMAT_RGB444 }, { AV_PIX_FMT_RGB555, SDL_PIXELFORMAT_RGB555 }, { AV_PIX_FMT_BGR555, SDL_PIXELFORMAT_BGR555 }, { AV_PIX_FMT_RGB565, SDL_PIXELFORMAT_RGB565 }, { AV_PIX_FMT_BGR565, SDL_PIXELFORMAT_BGR565 }, { AV_PIX_FMT_RGB24, SDL_PIXELFORMAT_RGB24 }, { AV_PIX_FMT_BGR24, SDL_PIXELFORMAT_BGR24 }, { AV_PIX_FMT_0RGB32, SDL_PIXELFORMAT_RGB888 }, { AV_PIX_FMT_YUYV422, SDL_PIXELFORMAT_YUY2 }, { AV_PIX_FMT_UYVY422, SDL_PIXELFORMAT_UYVY

    1.4K20发布于 2019-04-02
  • 来自专栏全志嵌入式那些事

    全志V851S使用Tina-SDK支持MIPI摄像头方法教程及源码

    this pixelformat name = YUV420 [CAMERA_DEBUG] fo[ 63.546341] [VIN_ERR]vin is not support this pixelformat VIN_ERR]vin is not support this pixelformat [ 81.029406] [VIN_ERR]vin is not support this pixelformat this pixelformat [ 81.048112] [VIN_ERR]vin is not support this pixelformat [ 81.054244] [VIN_ERR ]vin is not support this pixelformat [ 81.060641] [VIN_ERR]vin is not support this pixelformat [ pixelformat [ 81.079441] [VIN_ERR]vin is not support this pixelformat [ 81.085738] [VIN_ERR]vin

    60900编辑于 2024-05-26
  • 来自专栏嵌入式项目开发

    FFMPEG音视频开发: 完成摄像头、桌面本地录制与rtmp推流(windows)

    cloneFrame.bytesPerLine(); //qDebug()<<"mappedBytes:"<<cloneFrame.mappedBytes(); //qDebug()<<"pixelFormat :"<<cloneFrame.pixelFormat(); unsigned char rgb_buffer[VIDEO_WIDTH*VIDEO_HEIGHT*3]; if(cloneFrame.pixelFormat TO_RGB24(cloneFrame.bits(),rgb_buffer,cloneFrame.width(),cloneFrame.height()); } else if(cloneFrame.pixelFormat yuyv_to_rgb(cloneFrame.bits(),rgb_buffer,cloneFrame.width(),cloneFrame.height()); } else if(cloneFrame.pixelFormat =image.rgbSwapped(); //BGR格式转RGB image=image.mirrored(false, true); } if(cloneFrame.pixelFormat

    2.6K20编辑于 2022-01-12
  • 来自专栏一心无二用,本人只专注于基础图像算法的实现与优化。

    .net下灰度模式图像在创建Graphics时出现:无法从带有索引像素格式的图像创建graphics对象 问题的解决方案。

    if (image == null) { throw new ArgumentNullException("image"); } if ((image.PixelFormat & PixelFormat.Indexed) ! = PixelFormat.Undefined) { throw new Exception(SR.GetString("GdiplusCannotCreateGraphicsFromIndexedPixelFormat PixelFormat4bppIndexed PixelFormat8bppIndexed PixelFormat16bppGrayScale PixelFormat16bppARGB1555    == false) { Bmp.Dispose(); throw new Exception("Wrong PixelFormat

    6.9K80发布于 2018-01-03
  • 来自专栏林德熙的博客

    WPF 使用 SharpDX

    创建 RenderTargetProperties 需要参数 PixelFormat ,请看下面 var pixelFormat = new D2D.PixelFormat var renderTargetProperties = new D2D.RenderTargetProperties(D2D.RenderTargetType.Default, pixelFormat D2D.RenderTargetUsage.None, D2D.FeatureLevel.Level_DEFAULT); RenderTargetProperties 需要的参数是 RenderTargetType ,PixelFormat Loaded += (s, e) => { var factory = new D2D.Factory(); var pixelFormat var renderTargetProperties = new D2D.RenderTargetProperties(D2D.RenderTargetType.Default, pixelFormat

    1.7K10发布于 2018-09-19
  • 来自专栏AhDung

    【手记】解决Graphics.DrawImage带ImageAttributes在XP报内存不足的问题

    这个问题在外网也有一些讨论,我倾向的说法是,XP的GDI+组件存在问题,对于像素格式PixelFormat有点特别的图像,把它绘制到其它地方的时候处理不好ImageAttributes,于是引发异常。 解决思路,既然同时满足这两者会报错: g.DrawImage(PixelFormat特别的Image, xxx, imageAttributes) 那么只要错开其一就行,比如这两种就不会报: g.DrawImage (常规Image, xxx, imageAttributes); //方法一 g.DrawImage(PixelFormat特别的Image, xxx); //方法二,不使用imageAttributes

    1.4K30发布于 2019-09-04
  • 来自专栏烙馅饼喽的技术分享

    生成透明GIF的方法

    tempgif.LockBits(New Rectangle(0, 0, tempgif.Width, tempgif.Height), ImageLockMode.ReadOnly, tempgif.PixelFormat             'tempgif.Palette = pal             Dim outgif As New Bitmap(tempgif.Width, tempgif.Height, PixelFormat.Format8bppIndexed = outgif.LockBits(New Rectangle(0, 0, outgif.Width, outgif.Height), ImageLockMode.WriteOnly, outgif.PixelFormat

    1.3K130发布于 2018-05-02
  • 来自专栏林德熙的博客

    WPF 使用 DisplayConfigGetDeviceInfo 获取显示器名的方法

    DISPLAYCONFIG_SOURCE_MODE { public int width; public int height; public DISPLAYCONFIG_PIXELFORMAT pixelFormat; public POINTL position; } [StructLayout(LayoutKind.Sequential, CharSet public uint videoStandard; public uint scanLineOrdering; } private enum DISPLAYCONFIG_PIXELFORMAT { DISPLAYCONFIG_PIXELFORMAT_8BPP = 1, DISPLAYCONFIG_PIXELFORMAT_16BPP = 2, DISPLAYCONFIG_PIXELFORMAT_24BPP = 3, DISPLAYCONFIG_PIXELFORMAT_32BPP = 4, DISPLAYCONFIG_PIXELFORMAT_NONGDI

    15910编辑于 2025-12-24
  • 来自专栏一心无二用,本人只专注于基础图像算法的实现与优化。

    C#中使用FreeImage库加载Bmp、JPG、PNG、PCX、TGA、PSD等25种格式的图像(源码)。

    FreeImage_Load(fif, FileName, 0); int Bpp = FreeImage_GetBPP(Dib); PixelFormat ; break; case 4: PF = PixelFormat.Format4bppIndexed; break ; case 8: PF = PixelFormat.Format8bppIndexed; break; case 16: PF = PixelFormat.Format16bppRgb555; break; case PF = PixelFormat.Format32bppArgb; break; default: FreeImage_Free

    3.5K100发布于 2018-01-03
  • 来自专栏Harmony学习之路

    HarmonyOS学习路之开发篇—多媒体开发(图像开发 二)

    readPixel(Position pos) 读取指定位置像素的颜色值,返回的颜色格式为PixelFormat.ARGB_8888。 resetConfig(Size size, PixelFormat pixelFormat) 重置PixelMap的大小和像素格式配置,但不会改变原有的像素数据也不会重新分配像素数据的内存,重置后图像数据的字节数不能超过 writePixel(Position pos, int color) 向指定位置像素写入颜色值,写入颜色格式为PixelFormat.ARGB_8888。 writePixels(int color) 将所有像素都填充为指定的颜色值,写入颜色格式为 PixelFormat.ARGB_8888。 = PixelFormat.ARGB_8888; initializationOptions.editable = true; PixelMap pixelMap = PixelMap.create(

    69620编辑于 2023-10-14
  • 来自专栏一心无二用,本人只专注于基础图像算法的实现与优化。

    图像偏色检测算法,速度快,效果好,共享给大家。      式中 ,M、 N分别为图像的宽和高,以像素为单位。在 a - b色度平面上,等效圆的中心坐标为 ( da , db ) ,半径为 M 。等效

    ******** public static double GetColorCastFactor(Bitmap Bmp) { if (Bmp.PixelFormat = PixelFormat.Format24bppRgb) throw new ArgumentException("Only Support PixelFormat24RGB format Image ."); Bitmap Lab = new Bitmap(Bmp.Width, Bmp.Height, PixelFormat.Format24bppRgb); BmpData = Bmp.LockBits(new Rectangle(0, 0, Bmp.Width, Bmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb LabData = Lab.LockBits(new Rectangle(0, 0, Lab.Width, Lab.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb

    3.6K80发布于 2018-01-03
  • 来自专栏全栈程序员必看

    cocos2dx的图片载入「建议收藏」

    { ... } } //使用指定像素格式来初始化(默认是auto,依据图片解码的结果来确定) bool Texture2D::initWithImage(Image *image, PixelFormat return true; } } bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat pixelFormat, int pixelsWide, int pixelsHigh) { ... = Size((float)pixelsWide, (float)pixelsHigh); _pixelsWide = pixelsWide; _pixelsHigh = pixelsHigh; _pixelFormat = pixelFormat; _maxS = 1; _maxT = 1; //关闭alpha渐变 _hasPremultipliedAlpha = false; _hasMipmaps = mipmapsNum

    73810编辑于 2022-07-10
  • 来自专栏烙馅饼喽的技术分享

    asp.net生成透明gif的准完美方案

     src = gif.LockBits(New Rectangle(0, 0, gif.Width, gif.Height), Imaging.ImageLockMode.ReadOnly, gif.PixelFormat = gif2.LockBits(New Rectangle(0, 0, gif2.Width, gif2.Height), Imaging.ImageLockMode.WriteOnly, gif2.PixelFormat  src = gif.LockBits(New Rectangle(0, 0, gif.Width, gif.Height), Imaging.ImageLockMode.ReadOnly, gif.PixelFormat = gif2.LockBits(New Rectangle(0, 0, gif2.Width, gif2.Height), Imaging.ImageLockMode.WriteOnly, gif2.PixelFormat  src = gif.LockBits(New Rectangle(0, 0, gif.Width, gif.Height), Imaging.ImageLockMode.ReadOnly, gif.PixelFormat

    1.7K70发布于 2018-05-02
  • 来自专栏Flutter入门

    SDL2库(3)-Android 端源码简要分析(VideoSubSystem)参考

    , SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888 ; renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV; : case SDL_PIXELFORMAT_ABGR8888: case SDL_PIXELFORMAT_RGB888: case SDL_PIXELFORMAT_BGR888 : case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_NV12: case SDL_PIXELFORMAT_NV21: ) || (texture->format == SDL_PIXELFORMAT_YV12)); data->nv12 = ((texture->format == SDL_PIXELFORMAT_NV12

    3.3K40发布于 2018-12-14
  • 来自专栏Qt项目实战

    Qt音视频开发38-USB摄像头解码linux方案

    false; } //重新打印下宽高看下是否真正设置成功 struct v4l2_pix_format pix = format.fmt.pix; quint32 pixelformat = pix.pixelformat; qDebug() << TIMEMS << "cameraWidth" << cameraWidth << "cameraHeight" << cameraHeight << "width" << pix.width << "height" << pix.height; qDebug() << TIMEMS << "pixelformat" << QString ("%1%2%3%4").arg(QChar(pixelformat & 0xFF)).arg(QChar((pixelformat >> 8) & 0xFF)).arg(QChar((pixelformat >> 16) & 0xFF)).arg(QChar((pixelformat >> 24) & 0xFF)); //重新设置宽高为真实的宽高 cameraWidth = pix.width

    3.2K41发布于 2020-10-21
  • 来自专栏一心无二用,本人只专注于基础图像算法的实现与优化。

    基于Simple Image Statistics(简单图像统计,SIS)的图像二值化算法。

    我在代码中给出了判断一副图像是否是灰度图像的一个函数:   private bool IsGrayBitmap(Bitmap Bmp) { bool IsGray; if (Bmp.PixelFormat == PixelFormat.Format8bppIndexed) // .net中灰度首先必然是索引图像 { IsGray = true; BitmapData BmpData = Bmp.LockBits(new Rectangle(0, 0, Bmp.Width, Bmp.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb ); Bitmap GrayBmp = new Bitmap(Bmp.Width, Bmp.Height, PixelFormat.Format8bppIndexed); GrayBmpData = GrayBmp.LockBits(new Rectangle(0, 0, GrayBmp.Width, GrayBmp.Height), ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed

    1.3K60发布于 2018-01-03
  • 来自专栏叁金大数据

    C#中Image , Bitmap 和 BitmapData

    PixelFormat属性:返回图像的像素格式. 3. Palette属性:获取和设置图像所使用的颜色调色板. 4. Height Width属性:返回图像的高度和宽度. 5. PixelFormat属性:数据的实际像素格式. 4. Scan0属性:被锁定数组的首字节地址,如果整个图像被锁定,则是图像的第一个字节地址. 5. Stride属性:步幅,也称为扫描宽度. (new System.Drawing.Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format8bppIndexed ColorPalette tempPalette; 35 using (Bitmap tempBmp = new Bitmap(1, 1, System.Drawing.Imaging.PixelFormat.Format8bppIndexed System.Drawing.Rectangle(0, 0, map.Width, map.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format8bppIndexed

    3.3K20发布于 2018-09-04
  • 来自专栏sofu456

    dotnet bitmap(MemoryStream)

    MemoryStream(image)) //容易出现异常 { bmImage = new Bitmap(Image.FromStream(ms)); ms.Close(); } bitmapdata //PixelFormat (new System.Drawing.Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format8bppIndexed

    50910编辑于 2022-05-06
  • 来自专栏韩曙亮的移动开发专栏

    【OpenGL】八、初始化 OpenGL 渲染环境 ( 导入 OpenGL 头文件 | 链接 OpenGL 库 | 将窗口设置为 OpenGL 窗口 | 设置像素格式描述符 | 渲染绘制 ) ★

    PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; // 选择像素格式 , 如果返回 -1 , 说明选择像素格式失败 , 一般情况下该选择是成功的 int pixelFormat = ChoosePixelFormat(dc, &pfd); // 设置像素格式 SetPixelFormat(dc, pixelFormat, &pfd); 六、设置像素格式 ---- = ChoosePixelFormat(dc, &pfd); // 设置像素格式 SetPixelFormat(dc, pixelFormat, &pfd); 七、创建并设置 OpenGL PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; // 选择像素格式 , 如果返回 -1 , 说明选择像素格式失败 , 一般情况下该选择是成功的 int pixelFormat = ChoosePixelFormat(dc, &pfd); // 设置像素格式 SetPixelFormat(dc, pixelFormat, &pfd); // 创建 OpenGL

    2.5K01编辑于 2023-03-28
领券