| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2279 人关注过本帖
标题:解决“无法从带有索引像素格式的图像创建graphics对象”的实现过程
只看楼主 加入收藏
ltc611
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2019-5-13
收藏
 问题点数:0 回复次数:0 
解决“无法从带有索引像素格式的图像创建graphics对象”的实现过程
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim g As Graphics
        Dim p As New Pen(Brushes.Red)
        Dim img = Image.FromFile("C:\C4.bmp")

        Dim bmp = New Bitmap(img.Width, img.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
        g = Graphics.FromImage(bmp)
        g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
        g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
         = System.Drawing.
        g.DrawImage(img, 0, 0)
        PictureBox1.Image = bmp
        g = Graphics.FromImage(PictureBox1.Image)
        g.DrawEllipse(p, 300, 180, 100, 120)
        g.Dispose()
        p.Dispose()
    End Sub

[此贴子已经被作者于2019-5-13 23:57编辑过]

搜索更多相关主题的帖子: graphics System Dim img bmp 
2019-05-13 23:45
快速回复:解决“无法从带有索引像素格式的图像创建graphics对象”的实现过程
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015406 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved