2018년 9월 26일 수요일

[MFC] 인터넷 페이지 열기

1. 디폴트 브라우저로 웹페이지 열기
     디폴트 브라우저를 다음과 같이 얻는다.
wchar_t browser[MAX_PATH];
HFILE h = _lcreat("dummy.html", 0);
_lclose(h);
FindExecutable(L"dummy.html", NULL, browser);
DeleteFile(L"dummy.html");

      ShellExecute를 이용해서 url을 연다.
ShellExecute(NULL, L"open", browser, addr, NULL, 0);



2.  OpenURL()로 url 열기
CInternetSession session;
CInternetFile * pFile = (CInternetFile *)session.OpenURL(addr);
      이렇게만 해도 잘 열리지만, OpenURL이 실패할 경우 프로그램이 죽을 수 있다. try를 이용하여 crash를 막자.
CInternetSession session;
CInternetFile * pFile;
try
{
pFile = (CInternetFile *)session.OpenURL(addr);
}
catch(...)
{
return -1;
}

 3.  가장 중요한 것 - 작업이 끝난 후 pFile은 반드시 삭제해줘야 한다. 삭제하지 않으면 메모리 누수가 생긴다.
delete pFile;

2018년 9월 17일 월요일

NaraImage - Comparing images

NaraImage supports up-to-8 panes.
If you select multiple images using ctrl-click (or shift-click), they will show up in different panes.

Press 'd' to see the differences.

NaraImage supports several diff modes - Pixel, Block, Heatmap, and Overlap.
  - Pixel : Pixel-by-pixel comparison. Differences are represented as red dots.
  - Block : Block-by-block comparison. You can change the block size on the toolbar.
  - Heatmap : Pixel-by-pixel heatmap comparison (see above image).
  - Overlap : Two images are shown overlapped. If two images have different color space, this is the only diff mode you can use.

Press 'v' to peek a pixel value.

You can see the coordinates, pixel values, and the differences in the tooltips. Tooltip will be disappear as soon as you release 'v'.

NaraImage - Investigating images

You can zoom in and out by turning your mouse wheel, or by pressing + or -.
Each click, up or down, increases or decreases the zoom factor by 10%.

If you double click the image, it will be 2 times bigger.

If you double click while holding control key, it will zoom 5000%, which is called 'Extreme close-up'.
You can see pixel values directly on the images when you zoom more than 5000%.


There are of course, shortcuts for zooming.
Press '1' to zoom 50%
Press '2' to zoom 100%
Press '3' to zoom 150%
Press '4' to zoom 200%
Press 'z' to enter yourself.


2018년 9월 16일 일요일

NaraImage - Yet Another YUV file viewer

NaraImage v1.2.4

NaraImage is an image viewer which supports YUV/RGB raw files and compressed image formats, such as Bitmap, JPEG, PNG, etc.



Features
  • supports YUV / RGB raw files
  • supports compressed image formats, such as .bmp, .jpg, .png, etc
  • supports pure raw data files (16-bit integer, and float).
  • supports multiple pane (up to 8) to compare images.
  • compares images visually and with PSNR.
  • you can export an image (whole or a part of the image) as PNG or YUV file.
  • provides 6 different color themes.
Operating system
  Unfortunately, NaraImage only supports Windows.

Copyright
  NaraImage is free-software designed by naranicca.

Download