草庐IT

draw_pixel

全部标签

c# - 为什么 System.Drawing.Bitmap 构造函数中的 "stride"必须是 4 的倍数?

我正在编写一个应用程序,要求我采用专有位图格式(MVTecHalconHImage)并将其转换为C#中的System.Drawing.Bitmap。除了使用“获取指针”功能外,唯一帮助我完成此操作的专有功能包括我写入文件。这个函数很棒,它为我提供了指向像素数据、宽度、高度和图像类型的指针。我的问题是,当我使用构造函数创建System.Drawing.Bitmap时:newSystem.Drawing.Bitmap(width,height,stride,format,scan)我需要指定一个“步幅”,它是4的倍数。这可能是个问题,因为我不确定我的函数将使用多大尺寸的位图。假设我最终得到

c# - 为什么 System.Drawing.Bitmap 构造函数中的 "stride"必须是 4 的倍数?

我正在编写一个应用程序,要求我采用专有位图格式(MVTecHalconHImage)并将其转换为C#中的System.Drawing.Bitmap。除了使用“获取指针”功能外,唯一帮助我完成此操作的专有功能包括我写入文件。这个函数很棒,它为我提供了指向像素数据、宽度、高度和图像类型的指针。我的问题是,当我使用构造函数创建System.Drawing.Bitmap时:newSystem.Drawing.Bitmap(width,height,stride,format,scan)我需要指定一个“步幅”,它是4的倍数。这可能是个问题,因为我不确定我的函数将使用多大尺寸的位图。假设我最终得到

c# - 选择 System.Drawing.Icon 的大小?

我有一个图标,它有几种不同的尺寸(16像素、32像素、64像素)。我在其上调用ToBitmap(),但它始终返回32px图像。如何检索64px的? 最佳答案 这有帮助吗?IconsizedIcon=newIcon(Resources.ResourceIcon,newSize(64,64)); 关于c#-选择System.Drawing.Icon的大小?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/

c# - 选择 System.Drawing.Icon 的大小?

我有一个图标,它有几种不同的尺寸(16像素、32像素、64像素)。我在其上调用ToBitmap(),但它始终返回32px图像。如何检索64px的? 最佳答案 这有帮助吗?IconsizedIcon=newIcon(Resources.ResourceIcon,newSize(64,64)); 关于c#-选择System.Drawing.Icon的大小?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/

Android 14 Beta 4 更新发布,Pixel 手机 / Fold / Tablet 可下载

7月12日消息,谷歌今日面向Pixel用户推送了 Android14 Beta4版本更新(UPB4.230623.005),包含多项修复和优化。用户需要注册 Android Beta计划,然后就能自动获得Android14Beta4的无线(OTA)更新。符合条件的设备包括Pixel4a5G、5、5a、6、6Pro、6a、7、7Pro、7a,以及最新加入的PixelFold和PixelTablet系列设备。Android14Beta4彩蛋▲ Android14Beta4彩蛋修复了开发人员报告的问题:修复了导致通知停止显示和“快速设置”磁贴停止工作直到设备重新启动为止的系统问题。修复了有时会导致V

c# - 来自 System.Drawing.Color 的 System.Drawing.Brush

我正在为我们公司开发WinForm打印应用程序。打印文档时,我需要获取文档上每个控件的System.Drawing.Color属性,并创建一个System.Drawing.Brush对象来画出来。有没有办法将System.Drawing.Color值转换为System.Drawing.Brush值?注意:我已经尝试查看System.Windows.Media.SolidColorBrush()方法,但它似乎没有帮助。 最佳答案 使用SolidBrush类:using(SolidBrushbrush=newSolidBrush(you

c# - 来自 System.Drawing.Color 的 System.Drawing.Brush

我正在为我们公司开发WinForm打印应用程序。打印文档时,我需要获取文档上每个控件的System.Drawing.Color属性,并创建一个System.Drawing.Brush对象来画出来。有没有办法将System.Drawing.Color值转换为System.Drawing.Brush值?注意:我已经尝试查看System.Windows.Media.SolidColorBrush()方法,但它似乎没有帮助。 最佳答案 使用SolidBrush类:using(SolidBrushbrush=newSolidBrush(you

c# - 将 System.Windows.Media.Imaging.BitmapSource 转换为 System.Drawing.Image

我正在将两个库捆绑在一起。一个只提供System.Windows.Media.Imaging.BitmapSource类型的输出,另一个只接受System.Drawing.Image类型的输入。如何执行此转换? 最佳答案 privateSystem.Drawing.BitmapBitmapFromSource(BitmapSourcebitmapsource){System.Drawing.Bitmapbitmap;using(MemoryStreamoutStream=newMemoryStream()){BitmapEncode

c# - 将 System.Windows.Media.Imaging.BitmapSource 转换为 System.Drawing.Image

我正在将两个库捆绑在一起。一个只提供System.Windows.Media.Imaging.BitmapSource类型的输出,另一个只接受System.Drawing.Image类型的输入。如何执行此转换? 最佳答案 privateSystem.Drawing.BitmapBitmapFromSource(BitmapSourcebitmapsource){System.Drawing.Bitmapbitmap;using(MemoryStreamoutStream=newMemoryStream()){BitmapEncode

c# - 将 System.Windows.Media.Color 转换为 System.Drawing.Color

privatevoidDialogFont_Load(objectsender,EventArgse){LoadInstalledFonts();SetupInitialDialogSelections();lblPreview.ForeColor=colorPicker1.colorPickerControlView1.CurrentColor.Color;}我想将该值转换为System.Drawing.Color。有什么想法吗? 最佳答案 System.Windows.Media.Colormediacolor;//yourco