C# と VB.NET の質問掲示板

わんくま同盟

ASP.NET、C++/CLI、Java 何でもどうぞ

C# と VB.NET の入門サイト


(過去ログ 132 を表示中)
■78251 / )  画像縮小
□投稿者/ ぎみっく (2回)-(2015/12/29(Tue) 20:08:19)

分類:[.NET 全般] 

画像の縮小を行いたくて
あちこちに聞きながら行ってみたのですが
保存時にパラメータエラーが発生します
どう修正していいか
教えていただけますでしょうか?





Imports System.Drawing

private sub pic()
dim img as bitmap = image.fromfile(c:\hp\cc.jpg)
dim tate as integer = img.height
dim yoko as integer = image.width
'比率
dim tateyoko as integer
dim resize(1) as single
dim kotei as integer = 300
tateyoko = tate / yoko
select case tateyoko
case is 〉1 '縦長
resize(1) = kotei
resize(0) = kotei/tateyoko
case is 〈 1'横長
resize(1) = kotei/tateyoko
resize(0) = kotei
end select
dim saveimage as new bitmap(img,resize(0),resize(1))
saveimage.save(c:\hp\cc-2.jpg)

返信 編集キー/


管理者用

- Child Tree -