最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C語(yǔ)言讀取BMP圖像數(shù)據(jù)的源碼

 更新時(shí)間:2021年10月25日 11:06:34   投稿:shangke  
這篇文章主要介紹了C語(yǔ)言讀取BMP圖像數(shù)據(jù)的源碼,需要的朋友可以參考下

BMP是英文Bitmap(位圖)的簡(jiǎn)寫(xiě),它是Windows操作系統(tǒng)中的標(biāo)準(zhǔn)圖像文件格式,能夠被多種Windows應(yīng)用程序所支持。隨著Windows操作系統(tǒng)的流行與豐富的Windows應(yīng)用程序的開(kāi)發(fā),BMP位圖格式理所當(dāng)然地被廣泛應(yīng)用。這種格式的特點(diǎn)是包含的圖像信息較豐富,幾乎不進(jìn)行壓縮,但由此導(dǎo)致了它與生俱生來(lái)的缺點(diǎn)--占用磁盤(pán)空間過(guò)大。所以,目前BMP在單機(jī)上比較流行。

BMP文件格式分析

簡(jiǎn)介

BMP(Bitmap-File)圖形文件是Windows采用的圖形文件格式,在Windows環(huán)境下運(yùn)行的所有圖象處理軟件都支持BMP圖象文件格式。Windows系統(tǒng)內(nèi)部各圖像繪制操作都是以BMP為基礎(chǔ)的。Windows 3.0以前的BMP圖文件格式與顯示設(shè)備有關(guān),因此把這種BMP圖象文件格式稱為設(shè)備相關(guān)位圖DDB(device-dependent bitmap)文件格式。Windows 3.0以后的BMP圖象文件與顯示設(shè)備無(wú)關(guān),因此把這種BMP圖象文件格式稱為設(shè)備無(wú)關(guān)位圖DIB(device-independent bitmap)格式(注:Windows 3.0以后,在系統(tǒng)中仍然存在DDB位圖,象BitBlt()這種函數(shù)就是基于DDB位圖的,只不過(guò)如果你想將圖像以BMP格式保存到磁盤(pán)文件中時(shí),微軟極力推薦你以DIB格式保存),目的是為了讓W(xué)indows能夠在任何類型的顯示設(shè)備上顯示所存儲(chǔ)的圖象。BMP位圖文件默認(rèn)的文件擴(kuò)展名是BMP或者bmp(有時(shí)它也會(huì)以.DIB或.RLE作擴(kuò)展名)。

位圖文件結(jié)構(gòu)表
位圖文件 位圖文件頭 14 字節(jié)
位圖信息頭 40 字節(jié)
彩色表(調(diào)色板) 4N 字節(jié)
位圖數(shù)據(jù) x 字節(jié)

構(gòu)件詳解:

位圖文件頭
位圖文件頭包含文件類型、文件大小、存放位置等信息。結(jié)構(gòu)定義如下:

typedef struct tagBITMAPFILEHEADER
  {
        UNIT    bfType;
        DWORD   bfSize;
        UINT    bfReserved1;
        UINT    bfReserved2;
        DWORD   bfOffBits;
  }BITMAPFILEHEADER;

其中:
bfType 說(shuō)明文件類型,在windows系統(tǒng)中為BM。
bfSize 說(shuō)明文件大小。
bfReserved1 bfReserved2 保留,設(shè)置為0。
bfOffBits 說(shuō)明實(shí)際圖形數(shù)據(jù)的偏移量。

位圖信息頭

位圖信息頭包含位圖的大小、壓縮類型、和顏色格式,結(jié)構(gòu)定義如下:

typedef struct tagBITMAPINFOHEADER
  {
        DWORD   biSize;
        LONG    biWidth;
        LONG    biHeight;
        WORD    biPlanes;
        WORD    biBitCount;
        DWORD   biCompression;
        DWORD   biSizeImage;
        LONG    biXPelsPerMerer;
        LONG    biYPelsPerMerer;
        DWORD   biClrUsed;
        DWORD   biClrImportant;
  }BITMAPINFOHEADER;

其中:
biSize 說(shuō)明BITMAPINFOHEADER結(jié)構(gòu)所需字節(jié)數(shù),在windows系統(tǒng)中為28h
biWidth 說(shuō)明圖像寬度
biHeight 說(shuō)明圖像高度
biPlanes 為目標(biāo)設(shè)備說(shuō)明位面數(shù),其值設(shè)為1
biBitCount每個(gè)像素的位數(shù),單色位圖為1,256色為8,24bit為24。
biCompression壓縮說(shuō)明,BI_RGB:無(wú)壓縮,BI_RLE8:8位RLE壓縮,BI_RLE4:4位RLE壓縮
biSizeImage說(shuō)明圖像大小,如無(wú)壓縮,可設(shè)為0
biXPelsPerMeter水平分辨率
biYPelsPerMeter垂直分辨率
biClrUsed 位圖使用的顏色數(shù)
biImportant重要顏色數(shù)目 

彩色表

彩色表包含的元素與位圖所具有的顏色數(shù)目相同,像素顏色用結(jié)構(gòu)RGBQUAD來(lái)表示:

typedef struct tagRGBQUAD
{
        BYTE    rgbBlue;
        BYTE    rgbGreen;
        BYTE    rgbRed;
        BYTE    rgbReserved;
}RGBQUAD;

其中:
rgbBlue 指定藍(lán)色強(qiáng)度
rgbGreen 指定綠色強(qiáng)度
rgbRed 指定紅色強(qiáng)度
rgbReserved保留,設(shè)為0

位圖數(shù)據(jù)

緊跟在彩色表后的是圖像數(shù)據(jù)陣列,圖像每一掃描行由連續(xù)的字節(jié)組成,掃描行由底向上存儲(chǔ),陣列中第一字節(jié)為左下角像素,最后一字節(jié)為右上角像素。

源代碼1

/* File name:   bmpTest.c
   Description: Show all Info a bmp file has. including 
   FileHeader Info, InfoHeader Info and Data Part.
   Reference: BMP圖像數(shù)據(jù)的C語(yǔ)言讀取源碼
*/

#include "stdafx.h"
//#include <stdio.h>
#include <stdlib.h>

#define BITMAPFILEHEADERLENGTH 14   // The bmp FileHeader length is 14
#define BM 19778                    // The ASCII code for BM

/* Test the file is bmp file or not */
void bmpFileTest(FILE* fpbmp);
/* To get the OffSet of header to data part */
void bmpHeaderPartLength(FILE* fpbmp);
/* To get the width and height of the bmp file */
void BmpWidthHeight(FILE* fpbmp);
/* Show bmp file tagBITMAPFILEHEADER info */
void bmpFileHeader(FILE* fpbmp);
/* Show bmp file tagBITMAPINFOHEADER info */
void bmpInfoHeader(FILE* fpbmp);
/* Show the Data Part of bmp file */
void bmpDataPart(FILE* fpbmp);

unsigned int OffSet = 0;    // OffSet from Header part to Data Part
long BmpWidth = 0L;          // The Width of the Data Part
long BmpHeight = 0L;         // The Height of the Data Part

int main(int argc, char* argv[])
{
     /* Open bmp file */
//   FILE *fpbmp = fopen("lena.bmp", "r+");
     FILE *fpbmp = fopen("picture.bmp", "r+");

     if (fpbmp == NULL)
     {
	  fprintf(stderr, "Open lena.bmp failed!!!\n");
	  return 1;
     }

     bmpFileTest(fpbmp);                //Test the file is bmp file or not
     bmpHeaderPartLength(fpbmp);        //Get the length of Header Part
     BmpWidthHeight(fpbmp);             //Get the width and width of the Data Part
     bmpFileHeader(fpbmp);            //Show the FileHeader Information 
     bmpInfoHeader(fpbmp);	        //Show the InfoHeader Information
     bmpDataPart(fpbmp);                //Reserve the data to file 

     fclose(fpbmp);
     return 0;
}

/* Test the file is bmp file or not */
void bmpFileTest(FILE* fpbmp)
{     
     unsigned short bfType = 0;
     fseek(fpbmp, 0L, SEEK_SET);
     fread(&bfType, sizeof(char), 2, fpbmp);
     if (BM != bfType)
     {
	  fprintf(stderr, "This file is not bmp file.!!!\n");
	  exit(1);
     }
}

/* To get the OffSet of header to data part */
void bmpHeaderPartLength(FILE* fpbmp)
{
     fseek(fpbmp, 10L, SEEK_SET);
     fread(&OffSet, sizeof(char), 4, fpbmp);	
     //printf("The Header Part is of length %d.\n", OffSet);
}

/* To get the width and height of the bmp file */
void BmpWidthHeight(FILE* fpbmp)
{
     fseek(fpbmp, 18L, SEEK_SET);
     fread(&BmpWidth, sizeof(char), 4, fpbmp);
     fread(&BmpHeight, sizeof(char), 4, fpbmp);
     //printf("The Width of the bmp file is %ld.\n", BmpWidth);
     //printf("The Height of the bmp file is %ld.\n", BmpHeight);
}

/* Show bmp file tagBITMAPFILEHEADER info */
void bmpFileHeader(FILE* fpbmp)
{
     unsigned short bfType;              //UNIT        bfType;
     unsigned int   bfSize;              //DWORD       bfSize;
     unsigned short bfReserved1;         //UINT        bfReserved1;
     unsigned short bfReserved2;         //UINT        bfReserved2;
     unsigned int   bfOffBits;           //DWORD       bfOffBits;

     fseek(fpbmp, 0L, SEEK_SET);

     fread(&bfType,      sizeof(char), 2, fpbmp);
     fread(&bfSize,      sizeof(char), 4, fpbmp);
     fread(&bfReserved1, sizeof(char), 2, fpbmp);
     fread(&bfReserved2, sizeof(char), 2, fpbmp);
     fread(&bfOffBits,   sizeof(char), 4, fpbmp);

     printf("************************************************\n");
     printf("*************tagBITMAPFILEHEADER info***********\n");
     printf("************************************************\n");
     printf("bfType              is %d.\n", bfType);
     printf("bfSize              is %d.\n", bfSize);
     printf("bfReserved1         is %d.\n", bfReserved1);
     printf("bfReserved2         is %d.\n", bfReserved2);
     printf("bfOffBits           is %d.\n", bfOffBits);
}

/* Show bmp file tagBITMAPINFOHEADER info */
void bmpInfoHeader(FILE* fpbmp)
{
     unsigned int biSize;	          // DWORD        biSize;
     long         biWidth;                // LONG         biWidth;
     long         biHeight;               // LONG         biHeight;
     unsigned int biPlanes;               // WORD         biPlanes;
     unsigned int biBitCount;             // WORD         biBitCount;
     unsigned int biCompression;          // DWORD        biCompression;
     unsigned int biSizeImage;            // DWORD        biSizeImage;
     long         biXPelsPerMerer;        // LONG         biXPelsPerMerer;
     long     	  biYPelsPerMerer;        // LONG         biYPelsPerMerer;
     unsigned int biClrUsed;              // DWORD        biClrUsed;
     unsigned int biClrImportant;         // DWORD        biClrImportant;

     fseek(fpbmp, 14L, SEEK_SET);

     fread(&biSize,          sizeof(char), 4, fpbmp);
     fread(&biWidth,         sizeof(char), 4, fpbmp);
     fread(&biHeight,        sizeof(char), 4, fpbmp);
     fread(&biPlanes,        sizeof(char), 4, fpbmp);
     fread(&biBitCount,      sizeof(char), 4, fpbmp); 
     fread(&biCompression,   sizeof(char), 4, fpbmp);
     fread(&biSizeImage,     sizeof(char), 4, fpbmp);
     fread(&biXPelsPerMerer, sizeof(char), 4, fpbmp);
     fread(&biYPelsPerMerer, sizeof(char), 4, fpbmp);
     fread(&biClrUsed,       sizeof(char), 4, fpbmp);
     fread(&biClrImportant,  sizeof(char), 4, fpbmp);

     printf("************************************************\n");
     printf("*************tagBITMAPINFOHEADER info***********\n");
     printf("************************************************\n");
     printf("biSize              is %d. \n", biSize);
     printf("biWidth             is %ld.\n", biWidth);
     printf("biHeight            is %ld.\n", biHeight);
     printf("biPlanes            is %d. \n", biPlanes);
     printf("biBitCount          is %d. \n", biBitCount);
     printf("biCompression       is %d. \n", biCompression);
     printf("biSizeImage         is %d. \n", biSizeImage);
     printf("biXPelsPerMerer     is %ld.\n", biXPelsPerMerer);
     printf("biYPelsPerMerer     is %ld.\n", biYPelsPerMerer);
     printf("biClrUsed           is %d. \n", biClrUsed);
     printf("biClrImportant      is %d. \n", biClrImportant);
}

/* Show the Data Part of bmp file */
void bmpDataPart(FILE* fpbmp)
{
     int i, j;
//     unsigned char bmpPixel[BmpWidth][BmpHeight];
	 unsigned char bmpPixel[1000][1000];
	 //因?yàn)闀簳r(shí)還未找到好的方法,暫且長(zhǎng)和寬都設(shè)為1000,如果圖像的尺寸大于1000,則要重新設(shè)置


     unsigned char* bmpPixelTmp = NULL;
     FILE* fpDataBmp;

     /* New a file to save the data matrix */
     if((fpDataBmp=fopen("bmpData.dat","w+")) == NULL)
     {
	  fprintf(stderr, "Failed to construct file bmpData.dat.!!!");
	  exit(1);
     }
     
     fseek(fpbmp, OffSet, SEEK_SET);
     if ((bmpPixelTmp=(unsigned char*)malloc(sizeof(char)*BmpWidth*BmpHeight))==NULL)
     {
	  fprintf(stderr, "Data allocation failed.!!!\n");
	  exit(1);
     }
     fread(bmpPixelTmp, sizeof(char), BmpWidth*BmpHeight, fpbmp);

     /* Read the data to Matrix and save it in file bmpData.dat */
     for(i =0; i < BmpHeight; i++)
     {
	  fprintf(fpDataBmp, "The data in line %-3d:\n", i+1); 
	  for(j = 0; j < BmpWidth; j++)
	  {
	       bmpPixel[i][j] = bmpPixelTmp[BmpWidth*(BmpHeight-1-i)+j];
	       //fwrite(&chartmp, sizeof(char), 1, fpDataBmp);
	       fprintf(fpDataBmp, "%-3d ", bmpPixel[i][j]);
	       if ((j+1)%32 == 0)
	       {
		    fprintf(fpDataBmp, "\n");
	       }
	  }
     }
     /* Used to test the data read is true or false 
	You can open the file using Matlab to compare the data */
     //printf("bmpPixel[2][3]   is %d.\n", bmpPixel[2][3]);
     //printf("bmpPixel[20][30] is %d.\n", bmpPixel[20][30]);

     free(bmpPixelTmp);
     fclose(fpDataBmp);
}

源代碼2

// 讀取圖像2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
//#include <stdio.h>
#include <stdlib.h>


#define BITMAPFILEHEADERLENGTH 14   // The bmp FileHeader length is 14
#define BM 19778                    // The ASCII code for BM


/* Test the file is bmp file or not */
void bmpFileTest(FILE* fpbmp);
/* To get the OffSet of header to data part */
void bmpHeaderPartLength(FILE* fpbmp);
/* To get the width and height of the bmp file */
void BmpWidthHeight(FILE* fpbmp);
//get r,g,b data
void bmpDataPart(FILE* fpbmp);
// output data to corresponding txt file
void bmpoutput(FILE *fpout);

unsigned int OffSet = 0;    // OffSet from Header part to Data Part
long width ;          // The Width of the Data Part
long height ;         // The Height of the Data Part
unsigned char r[2000][2000],output_r[2000][2000];
unsigned char g[2000][2000],output_g[2000][2000];
unsigned char b[2000][2000],output_b[2000][2000];


int main(int argc, char* argv[])
{
     /* Open bmp file */
	unsigned char *fp_temp;


    FILE *fpbmp;
    FILE *fpout;


    fpbmp= fopen("lena.bmp", "rb");


    if (fpbmp == NULL)
    {
		printf("Open bmp failed!!!\n");
		return 1;
    }


    fpout= fopen("out.bmp", "wb+");
    if (fpout == NULL)
    {
		printf("Open out.bmp failed!!!\n");
		return 1;
    }
     
		bmpFileTest(fpbmp);                //Test the file is bmp file or not
		bmpHeaderPartLength(fpbmp);        //Get the length of Header Part
    BmpWidthHeight(fpbmp);             //Get the width and width of the Data Part
     
     
	//
	fseek(fpbmp, 0L, SEEK_SET);
	fseek(fpout, 0L, SEEK_SET);
	 
	fp_temp=(unsigned char *)malloc(OffSet);
	fread(fp_temp, 1, OffSet, fpbmp);
	fwrite(fp_temp,1,OffSet,fpout);
		 
	bmpDataPart(fpbmp);                //Reserve the data to file 
     

	/*
	 
	 
	 如果您想對(duì)圖片進(jìn)行處理,請(qǐng)您再這里插入處理函數(shù)!!!!!!!!!!!!!!!!!!
	 
	*/
	bmpoutput(fpout);
	fclose(fpbmp);
	fclose(fpout);
    return 0;
}


void bmpoutput(FILE* fpout)
{
	int i, j=0;
	int stride;
	unsigned char* pixout=NULL;
	   
	stride=(24*width+31)/8;
	stride=stride/4*4;
	pixout=(unsigned char *)malloc(stride);
	 
	fseek(fpout, OffSet, SEEK_SET);
	for(j=0;j<height;j++)
	{
	   for(i=0;i<width;i++)
			{
				pixout[i*3+2]=output_r[height-1-j][i];
				pixout[i*3+1]=output_g[height-1-j][i];
				pixout[i*3]  =output_b[height-1-j][i];
			}
		fwrite(pixout, 1, stride, fpout);

	}
}


void bmpDataPart(FILE* fpbmp)
{
    int i, j=0;
	int stride;
	unsigned char* pix=NULL;

	FILE* fpr;
	FILE* fpg;
	FILE* fpb;
     
    if((fpr=fopen("bmpr.txt","w+")) == NULL)
    {
		printf("Failed to construct file bmpr.txt.!!!");
		exit(1);
    }
    if((fpg=fopen("bmpg.txt","w+")) == NULL)
    {
		printf("Failed to construct file bmpg.txt.!!!");
		exit(1);
    }
	if((fpb=fopen("bmpb.txt","w+")) == NULL)
    {
	printf("Failed to construct file bmpb.txt.!!!");
	exit(1);
    }
 
    fseek(fpbmp, OffSet, SEEK_SET);
	stride=(24*width+31)/8;
	stride=stride/4*4;
	pix=(unsigned char *)malloc(stride);
 
	for(j=0;j<height;j++)
	{
		fread(pix, 1, stride, fpbmp);

		for(i=0;i<width;i++)
		{
			r[height-1-j][i] = pix[i*3+2];
			g[height-1-j][i] = pix[i*3+1];
			b[height-1-j][i] = pix[i*3];


			output_r[height-1-j][i] = pix[i*3+2];
			output_g[height-1-j][i] = pix[i*3+1];
			output_b[height-1-j][i] = pix[i*3];
		}
	}

	for(i =0; i < height; i++)
    {
		for(j = 0; j < width-1; j++)
		{   
			fprintf(fpb,"%4d",b[i][j]);
			fprintf(fpg,"%4d",g[i][j]);
			fprintf(fpr,"%4d",r[i][j]);
		}
		fprintf(fpb,"%4d\n",b[i][j]);
		fprintf(fpg,"%4d\n",g[i][j]);
		fprintf(fpr,"%4d\n",r[i][j]);
	}
  
	fclose(fpr);
	fclose(fpg);
	fclose(fpb); 
}


void bmpFileTest(FILE* fpbmp)
{     
     unsigned short bfType = 0;
 
     fseek(fpbmp, 0L, SEEK_SET);//seek_set 起始位置
     fread(&bfType, sizeof(char), 2, fpbmp);
     if (BM != bfType)
     {
		 printf("This file is not bmp file.!!!\n");
		 exit(1);
     }
}


/* To get the OffSet of header to data part */
void bmpHeaderPartLength(FILE* fpbmp)
{
    fseek(fpbmp, 10L, SEEK_SET);
    fread(&OffSet, sizeof(char), 4, fpbmp);  
    printf("The Header Part is of length %d.\n", OffSet);
}


/* To get the width and height of the bmp file */
void BmpWidthHeight(FILE* fpbmp)
{
    fseek(fpbmp, 18L, SEEK_SET);
    fread(&width, sizeof(char), 4, fpbmp);
    fseek(fpbmp, 22L, SEEK_SET);
    fread(&height, sizeof(char), 4, fpbmp);
    printf("The Width of the bmp file is %ld.\n", width);
    printf("The Height of the bmp file is %ld.\n", height);
}

到此這篇關(guān)于C語(yǔ)言讀取BMP圖像數(shù)據(jù)的源碼的文章就介紹到這了,更多相關(guān)讀取BMP圖像數(shù)據(jù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • C語(yǔ)言中實(shí)現(xiàn)KMP算法的實(shí)例講解

    C語(yǔ)言中實(shí)現(xiàn)KMP算法的實(shí)例講解

    KMP算法即字符串匹配算法,C語(yǔ)言中KMP可以避免指針回溯從而達(dá)到高效,接下來(lái)就來(lái)總結(jié)一下C語(yǔ)言中實(shí)現(xiàn)KMP算法的實(shí)例講解
    2016-06-06
  • c語(yǔ)言中g(shù)etch,getche,getchar的區(qū)別

    c語(yǔ)言中g(shù)etch,getche,getchar的區(qū)別

    getche() 和getch()很相似,它也需要引入頭文件conio.h,那它們之間的區(qū)別又在哪里呢?不同之處就在于getch()無(wú)返回顯示,getche()有返回顯示
    2013-09-09
  • C++關(guān)于Makefile的詳解含通用模板

    C++關(guān)于Makefile的詳解含通用模板

    今天小編就為大家分享一篇關(guān)于C++關(guān)于Makefile的詳解含通用模板,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧
    2018-12-12
  • C語(yǔ)言數(shù)據(jù)結(jié)構(gòu)之二叉樹(shù)的非遞歸后序遍歷算法

    C語(yǔ)言數(shù)據(jù)結(jié)構(gòu)之二叉樹(shù)的非遞歸后序遍歷算法

    這篇文章主要介紹了C語(yǔ)言數(shù)據(jù)結(jié)構(gòu)之二叉樹(shù)的非遞歸后序遍歷算法的相關(guān)資料,希望通過(guò)本文能幫助到大家,讓大家實(shí)現(xiàn)這樣的功能,需要的朋友可以參考下
    2017-10-10
  • Visual?Studio中的解決方案中不顯示項(xiàng)目分析

    Visual?Studio中的解決方案中不顯示項(xiàng)目分析

    這篇文章主要為大家介紹了Visual?Studio中的解決方案中不顯示項(xiàng)目問(wèn)題分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-11-11
  • 在C語(yǔ)言中比較兩個(gè)字符串是否相等的方法

    在C語(yǔ)言中比較兩個(gè)字符串是否相等的方法

    這篇文章主要介紹了在C語(yǔ)言中比較兩個(gè)字符串是否相等的方法,分別介紹了strcmp()函數(shù)和strcasecmp()函數(shù),注意功能區(qū)分,需要的朋友可以參考下
    2015-08-08
  • Qt學(xué)習(xí)教程之對(duì)話框消失動(dòng)畫(huà)效果

    Qt學(xué)習(xí)教程之對(duì)話框消失動(dòng)畫(huà)效果

    這篇文章主要給大家介紹了關(guān)于Qt學(xué)習(xí)教程之對(duì)話框消失動(dòng)畫(huà)效果的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2018-07-07
  • 一文掌握C++ 智能指針全部用法

    一文掌握C++ 智能指針全部用法

    學(xué)習(xí)智能指針有很多好處,可以幫我們C++程序員管理動(dòng)態(tài)分配的內(nèi)存的,它會(huì)幫助我們自動(dòng)釋放new出來(lái)的內(nèi)存,從而避免內(nèi)存泄漏,感興趣的朋友跟隨小編一起看看吧
    2021-08-08
  • C++使用BitBlt進(jìn)行窗口抓圖的方法

    C++使用BitBlt進(jìn)行窗口抓圖的方法

    這篇文章主要介紹了C++使用BitBlt進(jìn)行窗口抓圖的方法,幫助大家更好的理解和使用c++,感興趣的朋友可以了解下
    2021-01-01
  • C++中的枚舉enum類型使用示例詳解

    C++中的枚舉enum類型使用示例詳解

    枚舉和類相似,能夠定義一種新的數(shù)據(jù)類型,不同的是,枚舉是將一組整形常量組織在一起,所以和類的使用方法有一些類似之處,這篇文章主要介紹了C++中的枚舉enum類型使用示例詳解,需要的朋友可以參考下
    2024-08-08

最新評(píng)論

饶阳县| 进贤县| 渭源县| 靖边县| 瑞安市| 瑞金市| 南靖县| 肇东市| 墨竹工卡县| 康保县| 康马县| 湾仔区| 红河县| 靖西县| 上思县| 高唐县| 怀宁县| 凯里市| 石景山区| 永济市| 北京市| 广宗县| 汝阳县| 高唐县| 亚东县| 张北县| 大丰市| 临泽县| 信宜市| 大竹县| 德钦县| 安达市| 渝北区| 南溪县| 乌苏市| 鄂尔多斯市| 都安| 萨迦县| 阿拉善左旗| 嵩明县| 水富县|