• 大小: 47KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: 其他
  • 标签: 代码  获取资源  

资源简介

轻松获取exe,dll中的资源图片,并可以保存位ico,位图(BMP)格式

资源截图

代码片段和文件信息

//CAutoFont class implementation
#include “stdafx.h“
#include “AutoFont.h“

CAutoFont::CAutoFont()
{
lf.lfHeight=-12;
lf.lfWidth=0;
lf.lfEscapement=0;
lf.lfOrientation=0;
lf.lfWeight=FW_NORMAL;
lf.lfItalic=0;
lf.lfUnderline=0;
lf.lfStrikeOut=0;
lf.lfCharSet=DEFAULT_CHARSET; //ANSI_CHARSET;
lf.lfOutPrecision=OUT_DEFAULT_PRECIS;
lf.lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf.lfQuality=PROOF_QUALITY;
lf.lfPitchAndFamily=VARIABLE_PITCH | FF_ROMAN;
strcpy(lf.lfFaceName “Times New Roman“);

CreateFontIndirect(&lf);

fontColor=0;
hDC=NULL;
}

CAutoFont::CAutoFont(CString facename)
{
lf.lfHeight=-12;
lf.lfWidth=0;
lf.lfEscapement=0;
lf.lfOrientation=0;
lf.lfWeight=FW_NORMAL;
lf.lfItalic=0;
lf.lfUnderline=0;
lf.lfStrikeOut=0;
lf.lfCharSet=DEFAULT_CHARSET; //ANSI_CHARSET;
lf.lfOutPrecision=OUT_DEFAULT_PRECIS;
lf.lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf.lfQuality=PROOF_QUALITY;
lf.lfPitchAndFamily=VARIABLE_PITCH | FF_ROMAN;
strcpy(lf.lfFaceName (LPCTSTR)facename);

CreateFontIndirect(&lf);

fontColor=0;
hDC=NULL;
}

CAutoFont::CAutoFont(LOGFONT& logfont)
{
lf=logfont;
CreateFontIndirect(&lf);

fontColor=0;
hDC=NULL;
}

CAutoFont::CAutoFont(CFont font)
{
HFONT hFont=(HFONT)font;
Attach((HFONT)hFont);

GetLogFont(&lf);

fontColor=0;
hDC=NULL;
}

CAutoFont::~CAutoFont()
{
}

LONG CAutoFont::SetHeight(LONG height)
{
LONG l=lf.lfHeight;

Deleteobject();
lf.lfHeight=height;
CreateFontIndirect(&lf);

return l;
}

LONG CAutoFont::SetHeightA(LONG height)
{
LONG l=lf.lfHeight;

Deleteobject();
if (height>0)
height=0-height;
lf.lfHeight=height;
CreateFontIndirect(&lf);

return l;
}

LONG CAutoFont::SetWidth(LONG width)
{
LONG l=lf.lfWidth;

Deleteobject();
lf.lfWidth=width;
CreateFontIndirect(&lf);

return l;
}

LONG CAutoFont::SetEscapement(LONG esc)
{
LONG l=lf.lfEscapement;

Deleteobject();
lf.lfEscapement=esc;
CreateFontIndirect(&lf);

return l;
}

LONG CAutoFont::SetOrientation(LONG or)
{
LONG l=lf.lfOrientation;

Deleteobject();
lf.lfOrientation=or;
CreateFontIndirect(&lf);

return l;
}

LONG CAutoFont::SetWeight(LONG weight)
{
LONG l=lf.lfWeight;

Deleteobject();
lf.lfWeight=weight;
CreateFontIndirect(&lf);

return l;
}

BYTE CAutoFont::SetCharset(BYTE charset)
{
BYTE b=lf.lfCharSet;

Deleteobject();
lf.lfCharSet=charset;
CreateFontIndirect(&lf);

return b;
}

BYTE CAutoFont::SetOutPrecision(BYTE op)
{
BYTE b=lf.lfOutPrecision;

Deleteobject();
lf.lfOutPrecision=op;
CreateFontIndirect(&lf);

return b;
}

BYTE CAutoFont::SetClipPrecision(BYTE cp)
{
BYTE b=lf.lfClipPrecision;

Deleteobject();
lf.lfClipPrecision=cp;
CreateFontIndirect(&lf);

return b;
}

BYTE CAutoFont::SetQuality(BYTE qual)
{
BYTE b=lf.lfQuality;

Deleteobject();
lf.lfQuality=qual;
CreateFontIndirect(&lf);

return b;
}

BY

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         251  2001-08-31 16:12  File_ID.txt
     目录           0  2001-09-23 16:51  res\
     文件         400  2001-09-22 09:17  res\IconSnap.rc2
     文件       18270  2001-09-26 21:50  res\ButtonsWin3000.bmp
     文件         214  1999-09-17 12:11  res\Check.bmp
     文件        1270  1999-09-17 12:11  res\middlecheck.bmp
     文件         214  1999-09-17 12:11  res\UnCheck.bmp
     文件        1078  2001-09-26 23:43  res\IconSnap.ico
     文件        7542  2000-05-22 10:57  AutoFont.cpp
     文件        2340  1999-11-30 08:48  AutoFont.h
     文件       31677  1999-09-17 12:11  ChkListBox.cpp
     文件        5719  1999-09-17 12:11  ChkListBox.h
     文件       19722  2001-09-26 21:56  Dib.cpp
     文件        1328  2001-09-26 21:56  Dib.h
     文件       27744  2001-09-27 00:01  Icons.cpp
     文件        5361  2001-09-26 21:55  Icons.h
     文件        2556  2001-09-26 22:10  IconSnap.cpp
     文件        4751  2001-09-26 22:37  IconSnap.dsp
     文件         539  2001-09-22 09:17  IconSnap.dsw
     文件        1581  2001-09-23 20:41  IconSnap.h
     文件        6117  2001-09-27 00:11  IconSnap.rc
     文件       12222  2001-09-27 00:03  IconSnapDlg.cpp
     文件        2160  2001-09-26 22:37  IconSnapDlg.h
     文件        2866  2001-02-14 00:16  MemDC.h
     文件         932  2001-09-20 00:25  ReadMe.txt
     文件         958  2001-09-26 22:06  Resource.h
     文件         210  2001-09-22 09:17  StdAfx.cpp
     文件         999  2001-09-22 09:17  StdAfx.h
     文件        8681  2001-09-26 22:07  WBButton.cpp
     文件        4265  2001-07-13 00:30  WBButton.h

评论

共有 条评论