http://spiffybox.com/index.php?w=500&h=500&r=8&fg=EBF0F5&bd=95A5B6&bg=F3E5E5
http://www.spiffycorners.com/index.php?sc=box&bg=ffffff&fg=DFD9D9&sz=3px
2011년 3월 13일 일요일
css round 익스플로어 (IE6,7,8) 모두적용
CSS3 : border-radius
border-radius 는 박스의 라운드를 가능하게 해준다.
아직 이 방법이 적용 되지 않는 브라우저가 많으며 별도의 지정이 필요하다
.box{ width:600px;height:600px;
border: 10px solid #000;
/*확인을 위해 테두리를줌*/
background:#fff;
/*IE에서는 테두리가 배경색이된다*/
-moz-border-radius: 15px;
/*파이어폭스*/
-webkit-border-radius: 15px;
/*웹킷기반 브라우저 구글크롬 사파리*/
border-radius: 15px;
/* 오페라 10.5이상 */
behavior: url(ie-css3.htc);
/*IE6이상 IE-CSS3 핵사용*/
}
아주간단 html은 다음과 같다
따라서 다시 배경색을 지정 해 줬다.
ie-css3.htc 파일은 http://fetchak.com/ie-css3/ 에서 다운받기를 하면됨.
=======================================================
예제
<style type="text/css">
.box3 {
background-color: #ddd;
width: 110px;
height: 25px;
padding: 20px;
position: absolute;
top: 1px; left: 1px;
text-align: center;
font-weight: bold;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
-moz-box-shadow: 10px 10px 20px #000;
-webkit-box-shadow: 10px 10px 10px #000;
box-shadow: 10px 10px 20px #000;
behavior: url(ie-css3.htc);
}
</style>
<div class="box3">testest</div>
border-radius 는 박스의 라운드를 가능하게 해준다.
아직 이 방법이 적용 되지 않는 브라우저가 많으며 별도의 지정이 필요하다
.box{ width:600px;height:600px;
border: 10px solid #000;
/*확인을 위해 테두리를줌*/
background:#fff;
/*IE에서는 테두리가 배경색이된다*/
-moz-border-radius: 15px;
/*파이어폭스*/
-webkit-border-radius: 15px;
/*웹킷기반 브라우저 구글크롬 사파리*/
border-radius: 15px;
/* 오페라 10.5이상 */
behavior: url(ie-css3.htc);
/*IE6이상 IE-CSS3 핵사용*/
}
아주간단 html은 다음과 같다
박스내용
주석에서 달아 놓았듯이 테두리만 주면 IE에서는 모두 테두리색으로보인다.따라서 다시 배경색을 지정 해 줬다.
ie-css3.htc 파일은 http://fetchak.com/ie-css3/ 에서 다운받기를 하면됨.
=======================================================
예제
<style type="text/css">
.box3 {
background-color: #ddd;
width: 110px;
height: 25px;
padding: 20px;
position: absolute;
top: 1px; left: 1px;
text-align: center;
font-weight: bold;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
-moz-box-shadow: 10px 10px 20px #000;
-webkit-box-shadow: 10px 10px 10px #000;
box-shadow: 10px 10px 20px #000;
behavior: url(ie-css3.htc);
}
</style>
<div class="box3">testest</div>
css round
<style type="text/css">
#round_a {width: 100% ;background-color:transprant }
#round_a #r1{display:block;height:1px;overflow:hidden;}
#round_a #r2{display:block;height:1px;overflow:hidden;}
#round_a #r3{display:block;height:1px;overflow:hidden;}
#round_a #r4{display:block;height:1px;overflow:hidden;}
#round_a #r1,#r2,#r3,#r4,#r5{border: cyan;background: #ff0000;}
#round_a #r1{background: cyan;}
#round_a #r1{margin:0px 5px 0px 5px;}
#round_a #r2{border-left:solid 2px;border-right:solid 2px;margin:0px 3px 0px 3px;}
#round_a #r3{border-left:solid 1px;border-right:solid 1px;}
#round_a #r4{border-left:solid 1px;border-right:solid 1px;}
#round_a #r5{border-left:solid 1px;border-right:solid 1px;}
#round_a #r3{margin:0px 2px 0px 2px;}
#round_a #r4{height:2px;}
#round_a #r4{margin:0px 1px 0px 1px;}
#round_a #r5{padding:0px 5px 0px 5px;}
</style>
<table cellspacing=0 border=0 cellpadding=0>
<tr><td bgcolor=yellow> </td><td width=150 bgcolor=yellow>
<!--라운드 START-->
<div id=round_a>
<b id=r1></b><b id=r2></b><b id=r3></b><b id=r4></b>
<div id=r5 >
<!--라운드내부 START-->
content
<b>내용</b>
<!--라운드내부 END-->
</div>
<b id=r4></b><b id=r3></b><b id=r2></b><b id=r1></b>
</div>
<!--라운드 END-->
</td><td bgcolor=yellow> </td></tr>
</table>
#round_a {width: 100% ;background-color:transprant }
#round_a #r1{display:block;height:1px;overflow:hidden;}
#round_a #r2{display:block;height:1px;overflow:hidden;}
#round_a #r3{display:block;height:1px;overflow:hidden;}
#round_a #r4{display:block;height:1px;overflow:hidden;}
#round_a #r1,#r2,#r3,#r4,#r5{border: cyan;background: #ff0000;}
#round_a #r1{background: cyan;}
#round_a #r1{margin:0px 5px 0px 5px;}
#round_a #r2{border-left:solid 2px;border-right:solid 2px;margin:0px 3px 0px 3px;}
#round_a #r3{border-left:solid 1px;border-right:solid 1px;}
#round_a #r4{border-left:solid 1px;border-right:solid 1px;}
#round_a #r5{border-left:solid 1px;border-right:solid 1px;}
#round_a #r3{margin:0px 2px 0px 2px;}
#round_a #r4{height:2px;}
#round_a #r4{margin:0px 1px 0px 1px;}
#round_a #r5{padding:0px 5px 0px 5px;}
</style>
<table cellspacing=0 border=0 cellpadding=0>
<tr><td bgcolor=yellow> </td><td width=150 bgcolor=yellow>
<!--라운드 START-->
<div id=round_a>
<b id=r1></b><b id=r2></b><b id=r3></b><b id=r4></b>
<div id=r5 >
<!--라운드내부 START-->
content
<b>내용</b>
<!--라운드내부 END-->
</div>
<b id=r4></b><b id=r3></b><b id=r2></b><b id=r1></b>
</div>
<!--라운드 END-->
</td><td bgcolor=yellow> </td></tr>
</table>
2011년 3월 3일 목요일
SAMSUNG PC Share Manager
DIVX Player나 PC 등...
다른 거추장스러운 STB없이 동영상을 감상 할 수 없을까?
이런저런 고민을 하다
삼성전자 LCD TV는 네트웍으로 PC에서 공유한 동영상을 볼 수 있음을 알아 냈다.
먼저 pavv.co.kr 다운로드 센터에 가서
SAMSUNG PC Share Manager를 다운로드하여 설치한다.
설치 후
SAMSUNG PC Share Manager를 실행하면
다음과 같은 화면이 나온다.
다음 상단메뉴의 [공유] -> [접근권한설정]에서 다음과 같이 연결이 허용되지 않은 TV에 대하여 접근권한을 설정한다.
그리고 공유하고자 하는 폴더를 드래그앤 드롭하여 주고 버튼을 누르면 콘텐츠가 갱신된다.
이제 TV에서 내가 만든 DLNA 서버가 잘 동작하는지 확인해 보자.
리모컨의 와이즈링크 버튼을 누르면 다음과 같은 화면이 나온다.
빨간 버튼을 누르고 WiseLinkPro PC Server장치를 선택하면 이제 사용이 가능하다.
jpg 이미지의 dpi를 조절하자
uses jpeg;
procedure AjustarDPI(Origen, Destino: TStream; Rx,Ry: Word);
var
AP0: array[1..18] of byte;
Buffer: array[0..$FFFF] of Char;
Header: array[1..4] of byte;
Size: Integer;
begin
Origen.Seek(0,soFromBeginning);
Origen.ReadBuffer(Header,2);
if (Header[1] <> $FF) or (Header[2] <> $D8) then
raise Exception.Create('Identificador incorrecto');
Destino.WriteBuffer(Header,2);
FillChar(AP0,Sizeof(AP0),#0);
AP0[1]:= $FF;
AP0[2]:= $E0;
AP0[4]:= Sizeof(AP0) - 2;
AP0[5]:= Byte('J');AP0[6]:= Byte('F');AP0[7]:= Byte('I');AP0[8]:= Byte('F');
AP0[10]:= 1; AP0[11]:= 2;
AP0[12]:= 1;
AP0[13]:= Rx shr 8; AP0[14]:= Rx and $FF;
AP0[15]:= Ry shr 8; AP0[16]:= Ry and $FF;
Destino.WriteBuffer(AP0,Sizeof(AP0));
repeat
Origen.ReadBuffer(Header,4);
Size:= ((Header[3] shl 8) + Header[4]) - 2;
case Header[2] of
$FE, $E0..$EF: Origen.Seek(Size,soFromCurrent);
$01,$D0..$D9: begin
Destino.WriteBuffer(Header,2);
Origen.Seek(-2,soFromCurrent)
end
else
begin
Origen.ReadBuffer(Buffer,Size);
Destino.WriteBuffer(Header,4);
Destino.WriteBuffer(Buffer,Size);
end;
end;
until Header[2] = $DA;
Destino.CopyFrom(Origen,Origen.Size - Origen.Position);
end;
procedure SaveToFileDPI(Imagen: TJpegImage; Filename: String; Rx, Ry: Word);
var
Temp: TMemoryStream;
Stream: TFileStream;
begin
Temp:= TMemoryStream.Create;
try
Imagen.SaveToStream(Temp);
Stream:= TFileStream.Create(Filename, fmCreate);
try
AjustarDPI(Temp,Stream,Rx,Ry);
finally
Stream.Free;
end;
finally
Temp.Free;
end;
end;
//사용
SaveToFileDPI(MyJPEG,FileName,300,300);
//예제
var
j : TJpegImage;
begin
j := TJpegImage.Create;
j.Palette := 0;
j.CompressionQuality := 100;
j.PixelFormat := jf8Bit;
j.Grayscale := False;
j.Compress;
j.Assign(Image1.Picture.Bitmap);
j.SaveToFile(SourceFileName2);
SaveToFileDPI(j,SourceFileName2,200,200);
j.Free;
procedure AjustarDPI(Origen, Destino: TStream; Rx,Ry: Word);
var
AP0: array[1..18] of byte;
Buffer: array[0..$FFFF] of Char;
Header: array[1..4] of byte;
Size: Integer;
begin
Origen.Seek(0,soFromBeginning);
Origen.ReadBuffer(Header,2);
if (Header[1] <> $FF) or (Header[2] <> $D8) then
raise Exception.Create('Identificador incorrecto');
Destino.WriteBuffer(Header,2);
FillChar(AP0,Sizeof(AP0),#0);
AP0[1]:= $FF;
AP0[2]:= $E0;
AP0[4]:= Sizeof(AP0) - 2;
AP0[5]:= Byte('J');AP0[6]:= Byte('F');AP0[7]:= Byte('I');AP0[8]:= Byte('F');
AP0[10]:= 1; AP0[11]:= 2;
AP0[12]:= 1;
AP0[13]:= Rx shr 8; AP0[14]:= Rx and $FF;
AP0[15]:= Ry shr 8; AP0[16]:= Ry and $FF;
Destino.WriteBuffer(AP0,Sizeof(AP0));
repeat
Origen.ReadBuffer(Header,4);
Size:= ((Header[3] shl 8) + Header[4]) - 2;
case Header[2] of
$FE, $E0..$EF: Origen.Seek(Size,soFromCurrent);
$01,$D0..$D9: begin
Destino.WriteBuffer(Header,2);
Origen.Seek(-2,soFromCurrent)
end
else
begin
Origen.ReadBuffer(Buffer,Size);
Destino.WriteBuffer(Header,4);
Destino.WriteBuffer(Buffer,Size);
end;
end;
until Header[2] = $DA;
Destino.CopyFrom(Origen,Origen.Size - Origen.Position);
end;
procedure SaveToFileDPI(Imagen: TJpegImage; Filename: String; Rx, Ry: Word);
var
Temp: TMemoryStream;
Stream: TFileStream;
begin
Temp:= TMemoryStream.Create;
try
Imagen.SaveToStream(Temp);
Stream:= TFileStream.Create(Filename, fmCreate);
try
AjustarDPI(Temp,Stream,Rx,Ry);
finally
Stream.Free;
end;
finally
Temp.Free;
end;
end;
//사용
SaveToFileDPI(MyJPEG,FileName,300,300);
//예제
var
j : TJpegImage;
begin
j := TJpegImage.Create;
j.Palette := 0;
j.CompressionQuality := 100;
j.PixelFormat := jf8Bit;
j.Grayscale := False;
j.Compress;
j.Assign(Image1.Picture.Bitmap);
j.SaveToFile(SourceFileName2);
SaveToFileDPI(j,SourceFileName2,200,200);
j.Free;
윈도우 메세지를 받아먹는 3가지 방법
- 보내는 통신규약은 아래와 같다고 가정.
SendMessage(FindWindow(nil, 'frmDebug'), WM_USER+123, 0, lParam(LongInt(메세지)));
혹은 PostMessage
1. TApplicationEvents 이용.
1. 폼에디터에 TApplicationEvents 를 하나 박아넣음.
2. 박아넣은 TApplicationEvents 의 OnMessage 함수를 만든다. 아래와 같은 모양으로.
procedureTForm1.ApplicationEvents1Message(varMsg: tagMSG; varHandled: Boolean);
begin
ifMsg.message=WM_USER+123then begin
Memo1.Lines.Add(PChar(Msg.lParam));
end;
end;
begin
ifMsg.message=WM_USER+123then begin
Memo1.Lines.Add(PChar(Msg.lParam));
end;
end;
3. 특징
- F1 을 눌러서 헬프를 보면 알 수 있지만, SendMessage 로 보낸 건 못받아먹음. PostMessage 로 해야 함.
2. 메세지별 이벤트 핸들러 이용.
- 각 메세지별 이벤트 핸들러를 만든다. 아래의 모양으로.
<선언부>
procedureWM_USER123(varMSG: TMessage); messageWM_USER+123;
<구현부>
procedureTForm1.WM_USER123(varMSG: TMessage);
begin
Memo1.Lines.Add(PChar(MSG.LParam));
end;
begin
Memo1.Lines.Add(PChar(MSG.LParam));
end;
3. TForm 의 WndProc 을 오버라이딩해서 사용하는 방법.
- 아래와 같은 모양으로 구성.
<선언부>
procedureWndProc(varMessage: TMessage); override;
<구현부>
procedureTForm1.WndProc(varMessage: TMessage);
begin
ifMessage.Msg=WM_USER+123then begin
Memo1.Lines.Add(PChar(Message.LParam));
end;
begin
ifMessage.Msg=WM_USER+123then begin
Memo1.Lines.Add(PChar(Message.LParam));
end;
inherited;
end;
end;
한글 초성+중성+종성 조합하여 모든 글자 출력
초성, 중성, 종성의 상수테이블 정의
const 초성: array[0..18] ofWideString =
('ㄱ','ㄲ','ㄴ','ㄷ','ㄸ','ㄹ','ㅁ','ㅂ','ㅃ','ㅅ',
'ㅆ','ㅇ','ㅈ','ㅉ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ');
중성: array[0..20] ofWideString =
('ㅏ','ㅐ','ㅑ','ㅒ','ㅓ','ㅔ','ㅕ','ㅖ','ㅗ','ㅘ',
'ㅙ','ㅚ','ㅛ','ㅜ','ㅝ','ㅞ','ㅟ','ㅠ','ㅡ','ㅢ',
'ㅣ');
종성: array[0..27] ofWideString =
('','ㄱ','ㄲ','ㄳ','ㄴ','ㄵ','ㄶ','ㄷ','ㄹ','ㄺ','ㄻ',
'ㄼ','ㄽ','ㄾ','ㄿ','ㅀ','ㅁ','ㅂ','ㅄ','ㅅ','ㅆ',
'ㅇ','ㅈ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ');
TMemo 에 전부 출력해봄.
procedureTForm1.Button1Click(Sender: TObject);
var pwc: PWideChar;
i, j, k: Integer;
count: Integer;
begin
pwc:=GlobalAllocPtr(GHND, 4);
count:=0;
try
fori:=0toHigh(초성) do begin forj:=0toHigh(중성) do begin
fork:=0toHigh(종성) do begin
WORD(pwc^):=$AC00+ (i*21*28)+(j*28)+k;
Memo1.Lines.Add(pwc);
Inc(count);
end;
end;
end;
Memo1.Lines.Add('총 '+IntToStr(count));
finally
GlobalFreePtr(pwc);
end;
end;
const 초성: array[0..18] ofWideString =
('ㄱ','ㄲ','ㄴ','ㄷ','ㄸ','ㄹ','ㅁ','ㅂ','ㅃ','ㅅ',
'ㅆ','ㅇ','ㅈ','ㅉ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ');
중성: array[0..20] ofWideString =
('ㅏ','ㅐ','ㅑ','ㅒ','ㅓ','ㅔ','ㅕ','ㅖ','ㅗ','ㅘ',
'ㅙ','ㅚ','ㅛ','ㅜ','ㅝ','ㅞ','ㅟ','ㅠ','ㅡ','ㅢ',
'ㅣ');
종성: array[0..27] ofWideString =
('','ㄱ','ㄲ','ㄳ','ㄴ','ㄵ','ㄶ','ㄷ','ㄹ','ㄺ','ㄻ',
'ㄼ','ㄽ','ㄾ','ㄿ','ㅀ','ㅁ','ㅂ','ㅄ','ㅅ','ㅆ',
'ㅇ','ㅈ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ');
TMemo 에 전부 출력해봄.
procedureTForm1.Button1Click(Sender: TObject);
var pwc: PWideChar;
i, j, k: Integer;
count: Integer;
begin
pwc:=GlobalAllocPtr(GHND, 4);
count:=0;
try
fori:=0toHigh(초성) do begin forj:=0toHigh(중성) do begin
fork:=0toHigh(종성) do begin
WORD(pwc^):=$AC00+ (i*21*28)+(j*28)+k;
Memo1.Lines.Add(pwc);
Inc(count);
end;
end;
end;
Memo1.Lines.Add('총 '+IntToStr(count));
finally
GlobalFreePtr(pwc);
end;
end;
피드 구독하기:
글 (Atom)