・選択肢以外選べないようにする
DropDownStyle → DropDownList
・先頭の項目を表示
ComboBox1.SelectedIndex = 0
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Imager;
my $img = Imager->new;
$img->read( file=>'images.jpg' ) or die $img->errstr;
my $img_x = $img->getwidth();
my $img_y = $img->getheight();
print "width: $img_x, height: $img_y \n";
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Imager;
my $img = Imager->new;
$img->read( file=>'images.jpg' ) or die $img->errstr;
my $img_x = $img->getwidth();
my $img_y = $img->getheight();
#オブジェクトを上書き
$img = $img->scale( xpixels => $img_x/2, ypixels => $img_y/2 );
$img->write( file => 'half.jpg' ) or die $img->errstr;
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Imager;
#サイズを4分の1にして、jpgからpngに変換する
my $img = Imager->new;
$img->read( file=>'images.jpg' ) or die $img->errstr;
my $img_x = $img->getwidth();
my $img_y = $img->getheight();
$img = $img->scale( xpixels => $img_x/4, ypixels => $img_y/4 );
$img->write( file => 'quarter.png' ) or die $img->errstr;
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Imager;
my $img = Imager->new;
$img->read( file=>'images.jpg' ) or die $img->errstr;
my $img_x = $img->getwidth();
my $img_y = $img->getheight();
my $img2 = Imager->new;
$img2->read( file=>'half.jpg' ) or die $img2->errstr;
my $img2_x = $img2->getwidth();
my $img2_y = $img2->getheight();
$img = $img->paste(
left => $img_x - $img2_x,
top => $img_y - $img2_y,
img => $img2,
);
$img->write( file => 'mix.jpg' );
use strict;
use warnings;
use utf8;
use Encode;
sub debug{ print encode("shiftjis", (join "", @_)) }; #winOSコマンドプロンプト用
$_ = "ab_CD_ef_GH";
while(m/[a-z]+/g){
debug($&, "\n");
}
debug("-----------\n");
while(m/[a-z]+/ig){
debug($&, "\n");
}
Imports System.Text.RegularExpressions
Module Module1
Sub Main()
Dim str As String = "ab_CD_ef_GH"
Dim reg As New Regex("[a-z]+")
Dim match As Match = reg.Match(str)
While match.Success
Console.WriteLine(match.Value)
match = match.NextMatch()
End While
Console.WriteLine("-----------")
reg = New Regex("[a-z]+", RegexOptions.IgnoreCase)
match = reg.Match(str)
While match.Success
Console.WriteLine(match.Value)
match = match.NextMatch()
End While
End Sub
End Module