void CanvasGdiplus::DrawBitmapInt(const Bitmap& bitmap, int x, int y) { Gdiplus::Graphics* current = GetCurrentGraphics(); if(!bitmap.IsNull()) { current->DrawImage(bitmap.GetNativeBitmap(), x, y); } }
void CanvasGdiplus::DrawBitmapInt(const Bitmap& bitmap, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h) { Gdiplus::Graphics* current = GetCurrentGraphics(); if(!bitmap.IsNull()) { current->DrawImage(bitmap.GetNativeBitmap(), Gdiplus::Rect(dest_x, dest_y, dest_w, dest_h), src_x, src_y, src_w, src_h, Gdiplus::UnitPixel); } }
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); } }