标题:解决“无法从带有索引像素格式的图像创建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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-494714-1-1.html




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

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