• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ create_bitmap_ex函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中create_bitmap_ex函数的典型用法代码示例。如果您正苦于以下问题:C++ create_bitmap_ex函数的具体用法?C++ create_bitmap_ex怎么用?C++ create_bitmap_ex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了create_bitmap_ex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rand

CChannelN::CChannelN (TImage * pImg, TImage * pCodeImg, int n_Chan)
{
	m_nCurPosition = 0;
	m_nChan=n_Chan;
	pImage = pImg;
	pCodeImage = pCodeImg;

	m_sSize.x=pImage->ClientRect.right;
	m_sSize.y=pImage->ClientRect.bottom;

	m_nVScale=Form1->VScale();

	m_pnDisplayState = new long[m_sSize.x*m_nChan];
	for (int i = 0; i < m_sSize.x*n_Chan; i++) {  //
		m_pnDisplayState[i] = 0;//5- rand() %10;
	}
	allegro_init();
	set_gdi_color_format();
	install_keyboard();
	install_mouse();
	install_timer();

	bmpCanvas = create_bitmap_ex(32,m_sSize.x,m_sSize.y);
	bmpCodeCanvas  = create_bitmap_ex(32,pCodeImage->ClientRect.Width(),Form1->ImageCode->ClientRect.Height());
	m_nColor=makecol24(0,255,255);

	PenYellow= CreatePen(PS_SOLID,1, 0x0000ff00);
	PenBlack = CreatePen(PS_SOLID,1, 0x00000000);
	PenGray  = CreatePen(PS_SOLID,1, clGray);
	PenRed   = CreatePen(PS_SOLID,1, clRed);
}
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:31,代码来源:DrawView3.cpp


示例2: create_bitmap_ex

TDisplay3D::TDisplay3D(TImage * pImg,int nChan)//:CChannelN(pImg,Form1->ImageCode,nChan)
{
	pImage = pImg;
	int x=pImage->ClientRect.right;
	int y=pImage->ClientRect.bottom;
	bmpCanvasBackground = create_bitmap_ex(32,x,y);
	bmpCanvas = create_bitmap_ex(32,x,y);
	for (int i=0; i < 72; i++)
		Display3DBuffer[i].AddSample(0,0,0);
}
开发者ID:ALuehmann,项目名称:labstreaminglayer,代码行数:10,代码来源:DrawView3.cpp


示例3: Ship

NaroolLurker::NaroolLurker(Vector2 opos, double shipAngle,
ShipData *shipData, unsigned int code)
:
Ship(opos, shipAngle, shipData, code)
{
	STACKTRACE;
	weaponRange    = scale_range(get_config_float("Weapon", "Range", 0));
	weaponVelocity = scale_velocity(get_config_float("Weapon", "Velocity", 0));
	weaponDamage   = get_config_int("Weapon", "Damage", 0);
	weaponArmour   = get_config_int("Weapon", "Armour", 0);
	weaponDuration = get_config_int("Weapon", "Duration", 0);
	poison         = get_config_float("Weapon", "poison", 0);

	normalRechargeAmount = recharge_amount;

	cloak = FALSE;
	cloak_frame = 0;

	BITMAP *shpbmp = sprite->get_bitmap(0);
	int bpp = bitmap_color_depth(shpbmp);
	lightningbmp = create_bitmap_ex(bpp, shpbmp->w, shpbmp->h);
	clear_to_color(lightningbmp, makeacol(0,0,0,255));
	//maxsparktime = 2000;
	maxsparktime = get_config_float("Quirk", "maxsparktime", 2000);
	sparktime = maxsparktime;
	sparkpos = 0.5 * Vector2(lightningbmp->w,lightningbmp->h);

	Rmax = get_config_float("Quirk", "Rmax", 1);
}
开发者ID:argarak,项目名称:tw-light,代码行数:29,代码来源:shpnarlu.cpp


示例4: _gk_load_texture

GLuint _gk_load_texture( const GLYPH_GL_PIXELTYPE *pixeldata, int w, int h )
{
   GLuint textureId;
   
#if (GLYPH_TARGET == GLYPH_TARGET_ALLEGGL)

   BITMAP *temp;
   int i;
   
   /* Unfortunately, we currenly need to make a copy of the pixel data */
   
   temp = create_bitmap_ex( 8, w, h );
   
   for( i = 0; i < w*h; i++ )
      putpixel( temp, i%w, i/w, pixeldata[i] );
   
   allegro_gl_use_alpha_channel( TRUE );
   allegro_gl_use_mipmapping(FALSE);
   allegro_gl_set_texture_format( GL_ALPHA8 );
   
   textureId = allegro_gl_make_texture_ex( AGL_TEXTURE_ALPHA_ONLY, temp, GL_ALPHA8 );
   
   destroy_bitmap( temp );

#else

   glGenTextures( 1, &textureId );
   glBindTexture( GL_TEXTURE_2D, textureId );
   glTexImage2D( GL_TEXTURE_2D, 0, 1, w, h, 0, GL_ALPHA8, GL_UNSIGNED_BYTE, pixeldata );
   
#endif
   
   return textureId;
}
开发者ID:BackupTheBerlios,项目名称:openlayer-svn,代码行数:34,代码来源:glyph_to_opengl.c


示例5: _AL_MALLOC

/* color_copy_glyph_range:
 *  Colour font helper function. Copies (part of) a glyph range
 */
static FONT_COLOR_DATA *color_copy_glyph_range(FONT_COLOR_DATA *cf, int begin, int end)
{
   FONT_COLOR_DATA *newcf;
   BITMAP **gl;
   BITMAP *g;
   int num, c;
   
   if (begin<cf->begin || end>cf->end)
      return NULL;
   
   newcf = _AL_MALLOC(sizeof *newcf);

   if (!newcf)
      return NULL;

   newcf->begin = begin;
   newcf->end = end;
   newcf->next = NULL;
   num = end - begin;

   gl = newcf->bitmaps = _AL_MALLOC(num * sizeof *gl);
   for (c=0; c<num; c++) {
      g = cf->bitmaps[begin - cf->begin + c];
      gl[c] = create_bitmap_ex(bitmap_color_depth(g), g->w, g->h);
      int y;
      for (y = 0; y < g->h; y++){
          memcpy(gl[c]->line[y], g->line[y], g->w);
      }
      //blit(g, gl[c], 0, 0, 0, 0, g->w, g->h);
   }

   return newcf;
}
开发者ID:dacap,项目名称:allegro4-to-5,代码行数:36,代码来源:font.c


示例6: m_bmp

Alleg4Surface::Alleg4Surface(int width, int height, int bpp, DestroyFlag destroy)
  : m_bmp(create_bitmap_ex(bpp, width, height))
  , m_destroy(destroy)
  , m_lock(0)
{
  saveClip();
}
开发者ID:webbie1887,项目名称:aseprite,代码行数:7,代码来源:alleg_surface.cpp


示例7: save_bitmap_state

/* save_bitmap_state:
 *  Remember everything important about a screen bitmap.
 *
 *  Note: this must run even for SWITCH_BACKAMNESIA.  With the fbcon driver,
 *  writes to the screen would still show up while we are switched away.
 *  So we let this function run to redirect the screen to a memory bitmap while
 *  we are switched away.  We also let this run for SWITCH_AMNESIA just for
 *  consistency.
 */
static void save_bitmap_state(BITMAP_INFORMATION *info, int switch_mode)
{
   int copy;

   info->other = create_bitmap_ex(bitmap_color_depth(info->bmp), info->bmp->w, info->bmp->h);
   if (!info->other)
      return;

   copy = (switch_mode != SWITCH_AMNESIA) && (switch_mode != SWITCH_BACKAMNESIA);
   fudge_bitmap(info->bmp, info->other, copy);
   info->blit_on_restore = copy;

   info->acquire = info->other->vtable->acquire;
   info->release = info->other->vtable->release;

   info->other->vtable->acquire = info->bmp->vtable->acquire;
   info->other->vtable->release = info->bmp->vtable->release;

   #define INTERESTING_ID_BITS   (BMP_ID_VIDEO | BMP_ID_SYSTEM | \
				  BMP_ID_SUB | BMP_ID_MASK)

   info->other->id = (info->bmp->id & INTERESTING_ID_BITS) | 
		     (info->other->id & ~INTERESTING_ID_BITS);

   swap_bitmap_contents(info->bmp, info->other);
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:35,代码来源:dispsw.c


示例8: init

void init()
{
 allegro_init();

 set_color_depth(32);
 if(set_gfx_mode(GFX_AUTODETECT_WINDOWED, GFX_W, GFX_H, 0, 0))
  {
   allegro_message("Error: %s.", allegro_error);
   exit(1);
  }

 install_keyboard();
 install_mouse();

 buffer = create_bitmap(SCREEN_W, SCREEN_H);
 zbuffer = create_bitmap_ex(32, SCREEN_W, SCREEN_H);
 texture = load_bitmap("data/wall.bmp", NULL);
 skin = load_bitmap("data/babe_skin.bmp", NULL);
 texture2 = load_bitmap("data/color.bmp", NULL);

 setup_projection(90.0, -1.333, 1.333, -1.0, 1.0, -1.0, 200.0);
 init_renderer(GFX_H);
 bind_color_buffer(buffer);
 bind_zbuffer(zbuffer);
 bind_texture(texture);
}
开发者ID:omer4d,项目名称:SuperOldCode,代码行数:26,代码来源:bsp_map_renderer.c


示例9: counter

GameOver::GameOver(LinkClass& l):
    counter(0),
    link(l),
    subscrbmp(create_bitmap_ex(8, framebuf->w, framebuf->h))
{
    
}
开发者ID:PyroXFire,项目名称:ZeldaClassic,代码行数:7,代码来源:gameOver.cpp


示例10: ilutConvertToAlleg

// Does not account for converting luminance...
BITMAP* ILAPIENTRY ilutConvertToAlleg(PALETTE Pal)
{
	BITMAP *Bitmap;
	ILimage *TempImage;
	ILuint i = 0, j = 0;

	ilutCurImage = ilGetCurImage();

	if (ilutCurImage == NULL) {
		ilSetError(ILUT_ILLEGAL_OPERATION);
		return NULL;
	}

	// Should be IL_BGR(A), but Djgpp screws up somewhere along the line.
	if (ilutCurImage->Format == IL_RGB || ilutCurImage->Format == IL_RGBA) {
		iluSwapColours();
	}

	if (ilutCurImage->Origin == IL_ORIGIN_LOWER_LEFT)
		iluFlipImage();
	if (ilutCurImage->Type > IL_UNSIGNED_BYTE) {}  // Can't do anything about this right now...
	if (ilutCurImage->Type == IL_BYTE) {}  // Can't do anything about this right now...

	Bitmap = create_bitmap_ex(ilutCurImage->Bpp * 8, ilutCurImage->Width, ilutCurImage->Height);
	if (Bitmap == NULL) {
		return IL_FALSE;
	}
	memcpy(Bitmap->dat, ilutCurImage->Data, ilutCurImage->SizeOfData);

	// Should we make this toggleable?
	if (ilutCurImage->Bpp == 8 && ilutCurImage->Pal.PalType != IL_PAL_NONE) {
		// Use the image's palette if there is one

		// ilConvertPal is destructive to the original image
		// @TODO:  Use new ilCopyPal!!!
		TempImage = ilNewImage(ilutCurImage->Width, ilutCurImage->Height, ilutCurImage->Depth, ilutCurImage->Bpp, 1);
		ilCopyImageAttr(TempImage, ilutCurImage);
		ilSetCurImage(TempImage);

		if (!ilConvertPal(IL_PAL_RGB24)) {
			destroy_bitmap(Bitmap);
			ilSetError(ILUT_ILLEGAL_OPERATION);
			return NULL;
		}

		for (; i < ilutCurImage->Pal.PalSize && i < 768; i += 3, j++) {
			Pal[j].r = TempImage->Pal.Palette[i+0];
			Pal[j].g = TempImage->Pal.Palette[i+1];
			Pal[j].b = TempImage->Pal.Palette[i+2];
			Pal[j].filler = 255;
		}

		ilCloseImage(TempImage);
		ilSetCurImage(ilutCurImage);
	}

	return Bitmap;
}
开发者ID:jitrc,项目名称:p3d,代码行数:59,代码来源:ilut_allegro.c


示例11: create_bitmap_ex

void window_sub::resize_sub_buffer(coord_int w, coord_int h)
{
  if (sub_buffer) destroy_bitmap(sub_buffer);

  sub_buffer = create_bitmap_ex(bitmap_color_depth(get_master()->get_buffer()), w+1, h+1);     
  Assert(sub_buffer, "Error allocating new sub-buffer for window " << this);

  update_sub();
}
开发者ID:taliesinb,项目名称:penguin,代码行数:9,代码来源:psublim.cpp


示例12: create_bitmap_ex

void EditboxScriptView::init()
{
    EditboxNoWrapView::init();
    bottomarrow_y-=16;
    area_height-=16;
    leftarrow_y-=16;
    rightarrow_y-=16;
    linetext = create_bitmap_ex(8,host->w,16);
}
开发者ID:ZoriaRPG,项目名称:ZeldaClassic,代码行数:9,代码来源:EditboxView.cpp


示例13: UnicodeString

void TMainCaptureForm::SetToVideoMode() {

		Caption = "Four Channel Video stream: video camera";
		MainCaptureForm->Caption = UnicodeString("Video Stream, version ") + getVersion();

		allegro_init();
		set_gdi_color_format();
		set_color_depth(CDEPTH);
		bmpCanvas = create_bitmap_ex(CDEPTH,tPanel->Width,tPanel->Height);
		bmpCanvas1 = create_bitmap_ex(CDEPTH,tPanel1->Width,tPanel1->Height);
		bmpCanvas2 = create_bitmap_ex(CDEPTH,tPanel2->Width,tPanel2->Height);
		bmpCanvas3 = create_bitmap_ex(CDEPTH,tPanel3->Width,tPanel3->Height);

		clear_bitmap(bmpCanvas);
		clear_bitmap(bmpCanvas1);
		clear_bitmap(bmpCanvas2);
		clear_bitmap(bmpCanvas3);
}
开发者ID:cboulay,项目名称:labstreaminglayer,代码行数:18,代码来源:UMainCapture.cpp


示例14: reset

void VideoManager::initialize()
{
	reset();
	apeg_ignore_audio(true);

	frameData = create_bitmap_ex(32, 320, 192);
	clear_to_color(frameData, 0);
	videoBuffer = NULL;
}
开发者ID:AllenSeitz,项目名称:dance-maniax-update,代码行数:9,代码来源:VideoManager.cpp


示例15: AMesaCreateBuffer

AMesaBuffer GLAPIENTRY AMesaCreateBuffer(AMesaVisual visual, BITMAP* bmp)
{
	AMesaBuffer buffer;

	/* Buffer and visual must share the same color depth */
	if (bitmap_color_depth(bmp) != visual->Depth)
		return NULL;

	buffer = (AMesaBuffer) malloc(sizeof(struct amesa_buffer));
	if (!buffer)
		return NULL;

	buffer->FrontBuffer    = bmp;
	buffer->BackBuffer     = NULL;
	buffer->Active         = NULL;
	buffer->ReadActive     = NULL;
	buffer->DepthBuffer    = NULL;

	if (visual->DBFlag) {
		buffer->BackBuffer = create_bitmap_ex(visual->Depth, bmp->w, bmp->h);
		if (!buffer->BackBuffer) {
			free(buffer);
			return NULL;
		}
	}
	
	if (visual->GLVisual->depthBits > 0) {
		buffer->DepthBuffer = create_zbuffer(bmp);
		if (!buffer->DepthBuffer) {
			if (buffer->BackBuffer)
				destroy_bitmap(buffer->BackBuffer);
			free(buffer);
			return NULL;
		}
		set_zbuffer(buffer->DepthBuffer);
	}

	buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual,
                         0,   				    /*depth buffer is handled by Allegro */
                         visual->GLVisual->stencilBits > 0, /*software stencil buffer*/
                         visual->GLVisual->accumRedBits > 0,/*software accum buffer*/
                         GL_FALSE ); /*software alpha buffer*/

	if (!buffer->GLBuffer) {
		if (buffer->BackBuffer)
			destroy_bitmap(buffer->BackBuffer);
		if (buffer->DepthBuffer)
			destroy_zbuffer(buffer->DepthBuffer);
		free(buffer);
      		return NULL;
	}

	buffer->Width  = bmp->w;
	buffer->Height = bmp->h;

	return buffer;
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:57,代码来源:amesa.c


示例16: algif_render_frame

/* Renders the next frame in a GIF animation to the specified bitmap and
 * the given position. You need to call this in order on the same
 * destination for frames [0..gif->frames_count - 1] to properly render all
 * the frames in the GIF.
 */
void
algif_render_frame (GIF_ANIMATION *gif, BITMAP *bitmap, int frame, int xpos,
                    int ypos)
{
    int x, y, w, h;
    GIF_FRAME *f = &gif->frames[frame];
    GIF_PALETTE *pal;
    if (frame == 0)
        rectfill (bitmap, xpos, ypos, xpos + gif->width - 1,
              ypos + gif->height - 1, bitmap_mask_color (bitmap));
    else
    {
        GIF_FRAME *p = &gif->frames[frame - 1];
        if (p->disposal_method == 2)
            rectfill (bitmap, xpos + p->xoff, ypos + p->yoff,
                xpos + p->xoff + p->bitmap_8_bit->w - 1,
                ypos + p->yoff + p->bitmap_8_bit->h - 1,
                bitmap_mask_color (bitmap));
        else if (p->disposal_method == 3 && gif->store)
        {
            blit (gif->store, bitmap, 0, 0, xpos + p->xoff, ypos + p->yoff,
                gif->store->w, gif->store->h);
            destroy_bitmap (gif->store);
            gif->store = NULL;
        }
    }
    w = f->bitmap_8_bit->w;
    h = f->bitmap_8_bit->h;
    if (f->disposal_method == 3)
    {
        if (gif->store)
            destroy_bitmap (gif->store);
        gif->store = create_bitmap_ex (bitmap_color_depth (bitmap), w, h);
        blit (bitmap, gif->store, xpos + f->xoff, ypos + f->yoff, 0, 0, w, h);
    }
    pal = &gif->frames[frame].palette;
    if (pal->colors_count == 0)
        pal = &gif->palette;

    //int i;
    //for (i = 0; i < pal->colors_count; i++)
    //    printf("%d: %d %d %d\n", i, pal->colors[i].r, pal->colors[i].g, pal->colors[i].b);

    for (y = 0; y < h; y++)
    {
        for (x = 0; x < w; x++)
        {
            int c = getpixel (f->bitmap_8_bit, x, y);
            if (c != f->transparent_index)
            {
                putpixel (bitmap, xpos + f->xoff + x, ypos + f->yoff + y,
                          get_rgbcolor (&pal->colors[c]));
            }
        }
    }
}
开发者ID:boyjimeking,项目名称:paintown,代码行数:61,代码来源:gif.c


示例17: create_bitmap_ex

ZRadar::ZRadar(BITMAP *BlankSlate, Presence *target, double Size)
{
	STACKTRACE;
	Blank=BlankSlate;
	Painted = create_bitmap_ex(bitmap_color_depth(screen),Blank->w,Blank->h);
	t=target;
	size=Size;
	active=TRUE;
	set_depth(DEPTH_STARS + 0.1);
}
开发者ID:Yurand,项目名称:tw-light,代码行数:10,代码来源:radar.cpp


示例18: text_height

void BasicEditboxView::createStripBitmap(list<LineData>::iterator it, int width)
{
   //now create the bitmap
    int textheight = text_height(textfont);
  if(it->strip)
    destroy_bitmap(it->strip);
  it->strip = create_bitmap_ex(8,width,textheight);
  rectfill(it->strip, 0,0,width, textheight, bgcolor);
    Unicode::textout_ex_nonstupid(it->strip, textfont, (*it).line, 0, 0, fgcolor, bgcolor);
}
开发者ID:justingoldberg,项目名称:zelda-classic,代码行数:10,代码来源:EditboxView.cpp


示例19: Init_Games

void    Init_Games (void)
{
    game_running = GAME_RUNNING_NONE;
    slow_down_game = 0;
    games_bmp = create_bitmap_ex(16, 256, 192);
    BreakOut_Init ();
    Tetris_Init ();
    BrainWash_Init ();
    Pong_Init ();
}
开发者ID:dafyddcrosby,项目名称:meka,代码行数:10,代码来源:games.c


示例20: InitRenderToSurface

//Create the stream sample which will be used to call updates on the video
HRESULT InitRenderToSurface() {

    HRESULT hr;
    DDSURFACEDESC	ddsd;

    //Use the multimedia stream to get the primary video media stream
    hr = g_pMMStream->GetMediaStream(MSPID_PrimaryVideo, &g_pPrimaryVidStream);
    if (FAILED(hr)) {
        strcpy (lastError, "MMStream::GetMediaStream failed to create the primary video stream.");
        return E_FAIL;
    }

    //Use the media stream to get the IDirectDrawMediaStream
    hr = g_pPrimaryVidStream->QueryInterface(IID_IDirectDrawMediaStream, (void **)&g_pDDStream);
    if (FAILED(hr)) {
        strcpy(lastError, "The video stream does not support the IDirectDrawMediaStream interface; ensure you have the latest DirectX version installed.");
        return E_FAIL;
    }

    //Must set dwSize before calling GetFormat
    ddsd.dwSize = sizeof(ddsd);
    hr = g_pDDStream->GetFormat(&ddsd, NULL, NULL, NULL);
    if (FAILED(hr)) {
        strcpy(lastError, "IDirectDrawMediaStream::GetFormat failed");
        return E_FAIL;
    }

    RECT rect;
    rect.top = rect.left = 0;
    // these are the width and height of the video
    rect.bottom = ddsd.dwHeight;
    rect.right = ddsd.dwWidth;

    if (vscreen == NULL)
        vscreen = gfx_directx_create_system_bitmap(ddsd.dwWidth, ddsd.dwHeight);

    if (vscreen == NULL) {
        strcpy(lastError, "Unable to create the DX Video System Bitmap");
        return E_FAIL;
    }

    vsMemory = create_bitmap_ex(bitmap_color_depth(vscreen), vscreen->w, vscreen->h);

    IDirectDrawSurface *g_pDDSOffscreen;
    g_pDDSOffscreen = get_bitmap_surface (vscreen);

    //Create the stream sample
    hr = g_pDDStream->CreateSample(g_pDDSOffscreen, &rect, 0, &g_pSample);
    if (FAILED(hr)) {
        strcpy (lastError, "VideoStream::CreateSample failed");
        return E_FAIL;
    }

    return NOERROR;
}
开发者ID:smarinel,项目名称:ags-web,代码行数:56,代码来源:acwavi.cpp



注:本文中的create_bitmap_ex函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ create_client函数代码示例发布时间:2022-05-30
下一篇:
C++ create_bitmap函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap