掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VBAで、GDI+を使って画像を回転させるには? (ID:141080)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
アドバイスありがとうございます。 教えていただいた、GdipCreateBitmapFromScan0でやってみようと、WEB検索して、参考になりそうなCのコードを移植してみましたが、最初のGdipCreateBitmapFromScan0でエラーになってしまいます。どこがまずいのか教えていただけますでしょうか。Case PixelFormat32bppARGBの生成も自信が無いです。 なお、文中のコメントは元々のCのコードについていたコメントです。 Const PixelFormatGDI = &H20000 ' Is a GDI-supported format Const PixelFormatAlpha = &H40000 ' Has an alpha component Const PixelFormatCanonical = &H200000 Dim PixelFormat32bppARGB As Long (中略) '#define PixelFormat32bppARGB (10 | (32 << 8) | PixelFormatAlpha | PixelFormatGDI | PixelFormatCanonical) GdiPlusPixelFormats.hより PixelFormat32bppARGB = 10 Or BitShift(32, 8) Or PixelFormatAlpha Or PixelFormatGDI Or PixelFormatCanonical '; オフスクリーンバッファ Image 作成 retval = GdipCreateBitmapFromScan0(300, 200, 0, PixelFormat32bppARGB, 0, imgImage) '; オフスクリーンバッファ Graphics 作成 retval = GdipGetImageGraphicsContext(imgImage, imgGraphics) 'SmoothingModeHighQuality retval = GdipSetSmoothingMode(imgGraphics, 2) 'TextRenderingHintAntiAliasGridFit retval = GdipSetTextRenderingHint(imgGraphics, 4) (中略) Public Function BitShift(Value As Long, Shift As Long) As Long BitShift = Value * 2 ^ Shift End Function
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.