//------------------------------------------------------------------------ void pixel_map::create(unsigned width, unsigned height, org_e org, unsigned clear_val) { destroy(); if(width == 0) width = 1; if(height == 0) height = 1; m_bpp = org; create_from_bmp(create_bitmap_info(width, height, m_bpp)); create_gray_scale_palette(m_bmp); m_is_internal = true; if(clear_val <= 255) { memset(m_buf, clear_val, m_img_size); } }
//------------------------------------------------------------------------ HBITMAP pixel_map::create_dib_section(HDC h_dc, unsigned width, unsigned height, org_e org, unsigned clear_val) { destroy(); if(width == 0) width = 1; if(height == 0) height = 1; m_bpp = org; HBITMAP h_bitmap = create_dib_section_from_args(h_dc, width, height, m_bpp); create_gray_scale_palette(m_bmp); m_is_internal = true; if(clear_val <= 255) { memset(m_buf, clear_val, m_img_size); } return h_bitmap; }