2016년 1월 15일 금요일

Popup Menu Font 바꾸기

PopUpMenu1.OwnerDwar := True; 를 먼저 하고,
Screen.MenuFont.Name := frmStudyLaw2.Font.Name;
Screen.MenuFont.Size:= 11;   // frmStudyLaw2.Font.Size;
Screen.CaptionFont:= frmStudyLaw2.Font;
만약 폰트가 영역을 넘치면
So assign a handler for OnMeasureItem of the items of the popup menu either at design time, or at run time:
puMenuMain.OwnerDraw:=True;
Screen.MenuFont.Size:=18; 
for i := 0 to puMain.Items.Count - 1 do
  puMain.Items[i].OnMeasureItem := PopupMeasureItem;
where PopupMeasureItem can be as simple as
procedure TMyForm.PopupMeasureItem(Sender: TObject; ACanvas: TCanvas;
  var Width,   Height: Integer); 
begin
  Height := ACanvas.TextHeight('.') + 2;
end;
or you can determine the necessary height as the user selects from the list to save calling TextHeight each time an item is to be drawn.

2016년 1월 14일 목요일

class function

메인폼에서 다른폼을 부를때 메인폼에서 생성시킨후 보여주고 끝나면 프리시켜주는게 이제까지 사용하던 방법이었습니다.

불려야 할 폼이

type
TForm6 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
public
class function YesNo(istr:string): string;
end;
implementation
{$R *.dfm}
class function TForm6.YesNo(iStr:string): string;
var f: TForm6;
begin
Result:= '';
f:= TForm6.Create(Application);
try
f.Edit1.Text:= iStr;
if f.ShowModal = mrOk then
Result:= f.Edit1.Text;
finally
f.Free;
end;
end;

과 같이 만들어 두고

메인폼에서

uses Unit6;
procedure TForm5.Button1Click(Sender: TObject);
var iText: string;
begin
iText:= TForm6.YesNo('하하하');
ShowMessage(iText);
end;

이렇게 불러쓰면 한방에...

2016년 1월 12일 화요일

해상도가 올라가니..

EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

Writing DPI-Aware Desktop and Win32 Applications

This practical guide offers insight into writing DPI–aware Microsoft Win32 applications. Writing a DPI–aware application is the key to making a UI look consistently good across a wide variety of high-DPI display settings. Applications that are not DPI–aware but are running on a high-DPI display setting can suffer from many visual artifacts, including incorrect scaling of UI elements, clipped text, and blurry images. By adding support in your application for DPI awareness, you ensure that the presentation of your application's UI is more predictable, making it more visually appealing to users. This gives the user the best possible experience on any display.
Since Windows XP, dots per inch (DPI) settings have been a component of the Windows development platform. For many years, high density displays did not consume a large percentage of the market. Now, due to the clear and perceivable user benefits, such as text legibility and image presentation, high density displays are becoming increasingly popular, particularly in mobile form factors. With the growing relevance of high DPI devices, it is important to enable each monitor of a system to run with optimal DPI settings to take full advantage of all display hardware. Windows 8.1 adds developer support that enables desktop applications to not only become aware of different monitor DPI settings, but to also respond to any dynamic DPI changes. This gives the user with the best possible experience on any display.
Writing a DPI–aware application is the key to making a UI look consistent across a wide variety of DPI display settings. An application that is not DPI–aware but is running on a high DPI display or across monitors of different DPIs will be scaled by the system to the appropriate size so that it is still usable, but can suffer from visual artifacts including incorrect scaling of UI elements, clipped text, and blurriness. By adding support in your application for DPI awareness level, you can present your application’s UI in a predictable manner. By updating your app to respond to dynamic changes in DPI, you create an application that is crisp, making it more visually appealing to users.
Because manufacturers now ship greater numbers of high-resolution displays, you should not write applications that assume the default 96 DPI setting. For a list of optimal DPI configuration examples, see Appendix B: Optimal Configuration Examples. In Windows 8.1, each monitor in a configuration can run at a different DPI. This means that you should not write applications that assume that DPI is a static value that applies to all displays during a single session. To provide the best user experience, make sure that your applications are DPI–aware and can respond to changes in DPI.
This guide explores DPI features and issues in Windows XP, Windows Vista, and later versions of operating systems, with extra emphasis on Windows 8.1. It provides a set of guidelines for assessing DPI awareness level and a set of solutions that can help you address DPI awareness level issues.

High DPI Features in Windows

This section provides an overview of the high DPI features supported in Windows XP through Windows 8.1. The following table shows a list of high DPI-related features that are supported by each platform.
FeatureWindows XPWindows VistaWindows 7Windows 8Windows 8.1
Control Panel setting of DPIYesYesYesYesYes
DPI virtualization of not DPI–aware applicationsNoYesYesYesYes
DPI virtualization of system-DPI aware applicationsNoNoNoNoYes
API to declare DPI awareness levelNoYesYesYesYes*
APIs to retrieve system metrics and DPIYesYesYesYesYes
Window notificationNoNoNoNoYes
APIs to retrieve monitor DPINoNoNoNoYes
Requires a reboot/log off for monitor DPI changeN/AN/AN/AN/ANo
Requires a reboot/log off for system DPI changeRebootRebootLog offLog offLog off
Per user DPI settingNoNoYesYesYes
Auto configuration of DPI at first logonNoNoYesYesYes
Per monitor-DPI awareNoNoNoNoYes
Viewing distance incorporated in default DPI calculationNoNoNoNoYes

*These features have been updated and expanded to account for per monitor-DPI aware in Windows 8.1.
When you install Windows 7 onto a computer that supports extended display identification data (EDID), Windows 7 automatically configures the computer with an optimal high-DPI setting to make best use of the display's physical DPI, except in the cases where the display's effective resolution is less than 1024 x 768.
To change the user DPI setting, follow the instructions in the section Setting High DPI in Windows 7.

Setting DPI by Using Control Panel

Windows XP, Windows Vista, and later versions support the ability to change high-DPI display settings. For information about setting high-DPI on Windows XP, Windows Vista, and later versions, refer to Appendix A: Setting High DPI in Windows.
When the DPI settings are changed, the system fonts and system UI elements change in size. This is the primary reason that applications need to consider the system DPI setting in their rendering and layout code. Applications that are not DPI–aware can potentially exhibit some visual artifacts such as mismatched font sizes, clipped text, or clipped UI elements.

System DPI vs. Per-Monitor DPI

From Windows XP to Windows 8, Windows operated on a system-wide DPI, referred to as system DPI. Windows calculated the system DPI value on first logon with the goal of selecting the DPI that provides the best experience for the given hardware. Users can override the default system DPI in Control Panel to make the UI larger or smaller than the default. This override is explained in Appendix A: Setting High DPI in Windows.
Windows 8.1 introduces per-monitor DPI. On logon, Windows selects the optimal DPI for each monitor of the system. Users can still override these DPI values in Control Panel, as explained in Windows 8.1 Control Panel Overview. In Windows 8.1, system DPI is maintained for backward-compatibility. Many existing applications use system DPI to select which size to render. The system DPI also determines the size of system assets that an application uses. Additionally, APIs that do not have a monitor-specific context reflect values that are based on system DPI when not virtualized.

Categories of Applications

In Windows 8.1, desktop applications fall into three categories with respect to DPI:
  • Not DPI–aware applications
  • System–DPI aware applications
  • Per monitor–DPI aware applications

Not DPI–aware Applications

Not DPI–aware applications are applications that always render at 96 DPI, the lowest desktop DPI plateau. This class of applications are unaware of different system DPIs. The Desktop Window Manager (DWM)virtualizes and scales these applications to account for high DPI.

System–DPI Aware Applications

System–DPI aware applications are considered DPI–aware in Windows Vista through Windows 8. These applications render at the system DPI to avoid being scaled. These applications address the issues enumerated in Appendix C: Common High DPI Issues, but they do so on a system DPI level rather than per-monitor DPI because they cannot respond to dynamic changes in DPI during a single session. System–DPI aware applications render optimally on the primary display, and DWM does not scale and virtualize them. However, if the user moves the application to a display with a higher or lower DPI, DWM scales it up or down. The effect is that the window and content size are appropriate for every display, but the scaling introduces blurriness.

Per Monitor–DPI Aware Applications

Per monitor–DPI aware applications are a new class of applications in Windows 8.1. These applications dynamically scale up or down when a user changes the DPI or moves the application between monitors that have different DPIs. These applications always render crisply and at the correct size for a given display. DWM does not scale and virtualize this class of applications.
Note that the non-client area of a per monitor–DPI aware application is not scaled by Windows, and will appear proportionately smaller on a high DPI display.

DPI and the Desktop Scaling Factor

DPI is the physical measurement of the number of pixels in a linear inch of a display. For desktop monitors, this is typically 96 DPI or lower. However, newer displays for tablets and laptops may be 192 DPI or higher. In Windows 8.1, DPI values for the desktop are divided into four groups: 96, 120, 144, and 192. Each group contains a range of DPI values.
The desktop scaling factor is a percentage that indicates how Windows scales the UI of a desktop application when its DPI awareness level allows scaling. In general, the desktop scaling factor is based on the DPI:
  • 96 DPI = 100% scaling
  • 120 DPI = 125% scaling
  • 144 DPI = 150% scaling
  • 192 DPI = 200% scaling
In practice, other things can affect the desktop scaling factor, such as viewing distance or minimum required lines of vertical resolution. For example:
  • A projector that is 96 DPI may end up with a scaling factor of 125% or 150% because such devices have a higher optimal viewing distance than desktop monitors.
  • The Surface Pro is 212 DPI but has a 150% default scaling factor. This is because its native resolution of 1920x1080 would shrink to a logical resolution of 960x640 if a 200% scaling factor were used. That resolution is below the minimum resolution of 1024x720, so the scaling factor steps down to the next lower plateau of 150%

2016년 1월 8일 금요일

Delphi 에서 Castalia 사용하지 않으려면..

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\16.0\Known IDE Packages\Delphi]
"$(BDS)\\Bin\\Castalia220.bpl"="_Castalia"

델파이 폼 속성에 보면 스케일드 속성이 있는데...

델파이 폼 속성에 보면 스케일드 속성이 있는데...
Form2.Scaled:= True;
Form2.Scaled:= False;
하나 아무런 변화가 없다!
도움말에는 인치당 픽셀수를 변동 시키고 그렇지 않다고 했는데..

알고 보니 모니터의 해상도가 바뀔 때 폼의 절대크기가 아니라 모니터상에서 보이는 크기를 바귀게 할 것인지를 조절하는 것입니다.

즉, 800 x 640 화면에 form 크기를 800 x 640 으로 꽉찬 프로그램을 만들어 2560 * 1600 레티나 화면에서 실행하면 화면 한 모퉁이에 쪼그 맞게 보일 것입니다.

만약 Scaled 를 True 로 하면 2560 화면에 꽉찬 크기로 보여집니다.
단 폰트가 지원할때만 정확한 폰트크기로 변환됩니다.

2016년 1월 7일 목요일

RichView 와 RXLib를 같이 사용하면서

RichView 와 RXLib를 같이 사용하면 TGifImage 이 이미 등록되어 있다고 합니다.

RichView 에 있는 RvGifAnimate 안에 RegisterClass(TGifImage)를 삭제 시키라하는데,
dcu 만 있는 버전은 어찌 할수 가 없습니다.

예전버전에 있는 소오스 RvGifanimate.pas 파일을 구해와 현재의 dcu를 이름변경하고,
재설치하니 설치가 되었습니다.

2016년 1월 6일 수요일

RichEdit 에 Zoom 생겼어요. (Xe10)

XE10(아마도 8 부터이겠지요), RichEdit 에 글자를 쓰면은 아주 선명합니다.
또한 줌(Zoom) 기능이 있고요.
행간격을 조절할 수 도 있습니다.

uses Richedit; 가 필요 합니다.

procedure TForm1.ZQuery1AfterScroll(DataSet: TDataSet);
var iText: string;
ms: TMemoryStream;
iStrings: Tstrings;
Para: TParaFormat2;
begin
ms:= TMemoryStream.Create;
iStrings:= TstringList.Create;
try
iStrings.Text:= ZQuery1.FieldByName('icontent').AsString;
iStrings.SaveToStream(ms);
ms.Position:= 0;
RichEdit1.Lines.LoadFromStream(ms);
finally
ms.Free;
iStrings.Free;
end;
RichEdit1.SelectAll;
Para.cbSize:= SizeOf(Para);
Para.dwMask:= PFM_LINESPACING;
// Para.bLineSpacingRule:= 4;
Para.dyLineSpacing:= 120;
SendMessage(RichEdit1.Handle, EM_SETPARAFORMAT, 0, LPARAM(@Para));
RichEdit1.SelStart:= 0;
RichEdit1.SelLength:= 0;
RichEdit1.Zoom:= 150;
end;

2016년 1월 5일 화요일

델파이에서 Drag & Drop 이 갑자기 안되어서..

갑자기 사용하던 프로그램에서 드래그&드롭이 안되어서 황당했습니다.

바뀐 환경을 검토하여 보니, 윈도우 10으로 OS 가 바뀌였고, 항상 관리자모드로 프로그램을 실행하게 하고난 후였습니다.
관리자가 아닌 상태로 실행하니 정상이더군요.

결국
[제어판 > 관리도구 > 로칼보안정책 > 로컬정책 > 보안옵션 > 사용자 계정 컨트롤 : 기본제공자 계정에 대한 관리자 승인 모드 = 사용 안 함] 으로 바꾸어 해결하였습니다.

2016년 1월 4일 월요일

TIniFile 대신 TMemIniFile 사용하면?

(주)아이씨티 :: 최고의 시스템을 만드는 회사 에서 긁어 왔습니다. 이것도 이전에 몰라서 RXLib로 해결했었는데 델파이 안에 있었군요. 그나저나 델파이는 왜 예전의 헬프 파일을 지금처럼 바꾸어 알맹이가 없게하였는지....

TMemIniFile 클래스에 대해 살펴 보고자 한다.

1. 객체 위치
     TMemIniFile은 TIniFile처럼 IniFiles 유닛에 구현되어있다.
     C++Builder에서는 #include <IniFiles.hpp>
     Delphi에서는 Uses절에   IniFiles 를 추가하면 된다.

2. TIniFile 과 같은점 
    TIniFile처럼 TCustomIniFile 를 상속받았다.
     그래서 사용방법은 TIniFile클래스와 거의 동일하다

3. TIniFile과 MemIniFile의 다른점
 
   @ TIniFile은?

     ; TIniFile클래스는 Ini파일의 어떤 값을 읽어오거나 쓸때
       매번 File을 Open하여 읽기/쓰기 하고 File을 Close한다.
      즉 Read를 100번 반복하면 , 100번이나 File을 open/close하게 된다.
     
      * 많은 Data를 Read/Write할때 속도가 매우 느리다.
          매번 Section과 Key를 파일내용 검색해서 찾아야 할것이다.(windows-api)
      * 하지만 Key값 하나라도 Write하자마다 바로 file에 기록된다.
      * 또한 Read를 반복하더라도 중간에 File이 변경된것이 있으면 변경된 값을 읽어오게 된다.

  @ TMemIniFile은?
     ; 반면 MemIniFile은 이름이 말해 주듯이
       매번 File을 Open하여 읽기/쓰기 하지 않고,
       파일의 내용을 전부 한번에 읽어와 메모리에 가지고 있으며
       어떤 Key값을 Read/Write할때는 메모리에서 읽어오고 , 메모리에다가 쓰기만 한다.
       1) 메모리에서 읽고 쓰기 하니 , read/write 속도가 빠르다.
       2) 반면 write하더라도 UpdateFile() 함수를 호출하기 전까지는 파일에 적용이 되지 않는다.
       3) 당연한 얘기지만 중간에 파일 내용이 변경되더라도
          Read할때 Memory에서만 읽어오므로, 실제 파일의 값을 읽어오진 않는다.
   
     
4. MemIni 읽고 쓰기 예제

  
//---------------------------------------------------------------------------
#include "IniFiles.hpp"
//---------------------------------------------------------------------------
void __fastcall TForm6::Button1Click(TObject *Sender)
{
    TMemIniFile *MemIni=new TMemIniFile("D:\\Test.ini");
    MemIni->ReadString("HEADER","TEST_KEY","");
    MemIni->WriteString("HEADER","TEST_KEY","TEST_MEMINI_Data");
    MemIni->UpdateFile();
    delete MemIni;
}
//---------------------------------------------------------------------------
     


위와같이 간단한 Key 한두개를 읽고 쓰기 할때는 그냥 TIniFile이 좋을것이다.

하지만
파일 내용이 많고
Ini 객체를 만들어서 프로그램 중간중간 읽고/ 쓰기를 할경우엔  MemIni가 효율적일수 있다.


5. MemIni에서 Disk-File의 내용을 다시 읽어오려면?
   Rename함수를 호출해주면 된다.

void __fastcall TForm6::Button2Click(TObject *Sender)
{
     TMemIniFile *MemIni=new TMemIniFile("D:\\Test.ini");
     ShowMessage(MemIni->ReadString("HEADER","TEST_KEY","없나요?"));
     MemIni->Rename(MemIni->FileName,true);//같은 파일로 하면, load를 true로 해서 다시 load한다.
     ShowMessage(MemIni->ReadString("HEADER","TEST_KEY","없나요?"));
     delete MemIni;
}
//---------------------------------------------------------------------------



6. MemIni와 IniFile의 또 다른점 ?








   MemIni 파일을 save하면 파일 중간에 주석이나 공백 라인이 사라진다.



//원래 Ini 파일
  
[HEADER]
FILE_VER=2
TRAIN_COUNT=1
RFIDs=00008273,
AXIS_COUNT=4,
CAR_DIR=1,
ENTER_TIME=20120316134033
LEAVE_TIME=20120316134057

RECOGNIZE_RATE_ALL=100.0%,16/16
RECOGNIZE_RATE_NEL=100.0%,16/16

;NUM=fileName,기준,검사결과,두께1,두께2,두께3,(위치1),(위치2),(위치3)
;결과값 0=OK , 1=NG(위험) , 2=사진확인 , 3=Warning(주의) 


[00008273]
1=20120316134053_00008273_1_1_NEL.bmp, 5.00, 0, 17.79  , 0.00 , 0.00 , 425.18, 688.81 , 431.51 , 806.09 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 261.00, 624.96 , 717.00 , 598.81 , 0.1515 
2=20120316134053_00008273_1_2_NEL.bmp, 5.00, 0, 18.27  , 0.00 , 0.00 , 713.05, 675.39 , 713.20 , 793.27 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 412.00, 601.85 , 875.00 , 601.25 , 0.1550 
3=20120316134053_00008273_1_3_NEL.bmp, 5.00, 3, 8.23  , 0.00 , 0.00 , 529.30, 670.42 , 530.95 , 724.80 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 367.00, 593.64 , 824.00 , 580.18 , 0.1513 
     
 












//MemIni로 Load한후에 UpdateFile하면?
다음과 같이 주석이나 공백라인이 다 사라지게 된다.
  
[HEADER]
FILE_VER=2
TRAIN_COUNT=1
RFIDs=00008273,
AXIS_COUNT=4,
CAR_DIR=1,
ENTER_TIME=20120316134033
LEAVE_TIME=20120316134057
RECOGNIZE_RATE_ALL=100.0%,16/16
RECOGNIZE_RATE_NEL=100.0%,16/16

[00008273]
1=20120316134053_00008273_1_1_NEL.bmp, 5.00, 0, 17.79  , 0.00 , 0.00 , 425.18, 688.81 , 431.51 , 806.09 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 261.00, 624.96 , 717.00 , 598.81 , 0.1515
2=20120316134053_00008273_1_2_NEL.bmp, 5.00, 0, 18.27  , 0.00 , 0.00 , 713.05, 675.39 , 713.20 , 793.27 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 412.00, 601.85 , 875.00 , 601.25 , 0.1550
3=20120316134053_00008273_1_3_NEL.bmp, 5.00, 3, 8.23  , 0.00 , 0.00 , 529.30, 670.42 , 530.95 , 724.80 , 0.00, 0.00 , 0.00 , 0.00 , 0.00, 0.00 , 0.00 , 0.00 , 367.00, 593.64 , 824.00 , 580.18 , 0.1513
     



7. MemIni에만 있는 기능?
    그리고 TIniFile에는 없으면서 MemIniFile에만 있는 기능이 있다.
    그것은 파일이 저장이 없이,  INI 방식의 Memory상의 저장소로 사용이 가능하다는 것이다.
  
void __fastcall TForm6::Button3Click(TObject *Sender)
{
    TMemIniFile *MemIni=new TMemIniFile(""); //file-nothing
    MemIni->WriteString("HEADER","TEST_KEY","Memery save");
    ShowMessage(MemIni->ReadString("HEADER","TEST_KEY",""));
    delete MemIni;
}
//---------------------------------------------------------------------------
     


         
     
현재 ICT  Project에 TIniFile을 많이 쓰고 있다.

많은 Key를 read/write하고 있기 때문에 속도가 많이 느린 편이다.

장단점을 잘 파악하여, MemIniFile로 변경을 고려해 볼 필요가 있을것 같다.

     
     

크리에이티브 커먼즈 라이선스
Creative Commons License

RichEdit에 RTF 쓰기

얼마전 RichEdit에 RTF를 DB에서 불러와 써보려고 구굴링했었는데 찾지못해서 다른 방법으로 해결하였었습니다.
(주)아이씨티::최고의 시스템을 만드는 회사 에서 찾았습니다.
아래 긁어온 내용...

다음 그림과 같이 rtf형식의 문자열이 Memo에 들어있는데..
이놈을 어떻게 RichEdit 에 넣을까?


[안되는 방법들..]
다음과 같은 방법으로 해서는 양식적용이 안된다.
안되는 방법1. 
    RichEdit->Lines->Assign( Memo1->Lines) ;

안되는 방법2
   RichEdit->Lines->Text = Memo1->Lines->Text  ;

위 두가지 방법은
그냥 text형식으로 richedit에 들어간다.

[되는 방법들..]

RichEdit에서 rtf 형식을 판단하는 부분은 
Stream으로 읽을때 하고 있다.
 파일스트림, 메모리스트림, 리소스 스트림등...

1. 리소스에 넣었다가 리소스 스트림으로 읽어오는 방법
  void __fastcall TForm1::Button2Click(TObject *Sender)
 {
TResourceStream *ResSt;
try
{
 ResSt = new TResourceStream((int)HInstance, L"RTF_DOCUMENT",L"RTF");
 RichEdit1->Lines->LoadFromStream(ResSt);
}
__finally
{
 delete ResSt;
}
 }
2. 파일에서 읽어오는 방법
   RichEdit1->Lines->LoadFormFile("파일명");
   //확장자가 rtf 가 아니라도 잘 판단해서 읽어온다.

3. 메모장의 내용을 Stream으로  내보냇다가 읽어오기 

void __fastcall TForm1::Button4Click(TObject *Sender)
{
TMemoryStream *ms=new TMemoryStream;
Memo1->Lines->SaveToStream(ms);
ms->Position=0;
RichEdit1->Lines->LoadFromStream(ms);
delete ms;
}

4.  문자열을 Stream에 넣어서 RichEdit로 ...

void __fastcall TForm1::Button6Click(TObject *Sender)
{
AnsiString sText=Memo1->Lines->Text;
TMemoryStream *ms=new TMemoryStream;
ms->WriteBuffer(sText.c_str(),sText.Length());
ms->Position=0;
RichEdit1->Lines->LoadFromStream(ms);
delete ms;
}


5. Unnicode문자열인 경우엔 다음과 같이..

void __fastcall TForm1::Button5Click(TObject *Sender)
{
String sText=Memo1->Lines->Text;
TEncoding* Encoding= TEncoding::Default;
TBytes Buffer=Encoding->GetBytes(sText);
TMemoryStream *ms=new TMemoryStream;
ms->WriteBuffer(&Buffer[0],Buffer.Length);
ms->Position=0;
RichEdit1->Lines->LoadFromStream(ms);
delete ms;
}


유니코드인경우엔..
정확한 메모리크기가 바로 나오지 않기때문에
Encoding 정보를 이용해서 길이를 파악하여서 Stream으로 밀어 넣어야 한다.

주의할점
Richedit에서 Stream을 읽을대 현재 Stream->Position부터 읽어들인다.
즉 RicheEdit로 LoadFormStream하기 전에 반드시 Stream의 Position을 0 (초기위치)으로 셋팅을 해줘야 한다.


그럼...
크리에이티브 커먼즈 라이선스
Creative Commons License

2016년 1월 1일 금요일

맥북프로로 윈도우10을 부트캠프로 올릴경우 한영변환 한자변환

맥북프로로 윈도우10을 부트캠프로 올릴경우 한영변환 한자변환키가 평소에 사용하던 키와 다르고 윈도우키가 가끔 동작하여 수번의 시행 착오 끝에 인터넷에 돌고 있는 레지스트리화일에 오류가 있음을 발견하고 수정합니다. (2016.1.1 기준)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,72,00,5C,E0,71,00,38,E0,00,00,00,00

기존에 인터넷에 돌고 있는 것은 71,00,37,e0로 잘못 되어 있더군요. 이게 맞습니다.

적용후 캡춰 사진입니다.

맥에서 한글 / 영문 전환 또는 한자 입력..

Karabiner 라는 키보드 리맵퍼로 맥사용자분들 께는 널리 알려진 유틸리티가 있다네요.
2015.12.31 현재 최신버전을 내려받아 설치한후, 목록에서 For Korean 카테고리에서 애플키보드를 선택하시면 됩니다. 우측 Command 가 한영 전환 우측 Option(alt) 韓字 입니다. 그런데 이곳 에서는 글자가 선택되어 있지 않은 상태에서는 리턴키로 되네요.

선택 즉시 적용이 됩니다.

이왕지사 손된김에 del 키를 shift + Delete 로 바꾸었습니다.
윈도우에서는 https://github.com/niceview/KoreanKeyboard4MacBook 참고하세요.


prophet 를 이용하여 시계열 예측을 할때 설치가 안될때(fbprophet)

 pip install fbprophet 으로 설치가 안될때 python -m pip install prophet 으로 설치하고. fbprophet을 prophet으로 바꾸어 준다. from prophet import Prophet from p...