Esempio n. 1
0
void DesktopWindow::drawImage(const RECT *src, const RECT *dst)
{
  Rect rc_src(src);
  Rect rc_dest(dst);

  AutoLock al(&m_bufferLock);
  m_framebuffer.stretchFromDibSection(&rc_dest, &rc_src);
}
Esempio n. 2
0
    void CanvasGdiplus::TileImageInt(const Bitmap& bitmap,
        int src_x, int src_y, int dest_x, int dest_y, int w, int h)
    {
        if(!IntersectsClipRectInt(dest_x, dest_y, w, h))
        {
            return;
        }

        Gdiplus::Graphics* current = GetCurrentGraphics();
        if(!bitmap.IsNull())
        {
            Gdiplus::Bitmap* native_bitmap = bitmap.GetNativeBitmap();
            Gdiplus::ImageAttributes ia;
            ia.SetWrapMode(Gdiplus::WrapModeTile);
            Gdiplus::Rect rc_dest(dest_x, dest_y, w, h);
            current->DrawImage(native_bitmap,
                rc_dest, src_x, src_y,
                native_bitmap->GetWidth()-src_x,
                native_bitmap->GetHeight()-src_y,
                Gdiplus::UnitPixel, &ia);
        }
    }