diff options
Diffstat (limited to 'Linux_C_12/cpicture_121.c')
-rw-r--r-- | Linux_C_12/cpicture_121.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/Linux_C_12/cpicture_121.c b/Linux_C_12/cpicture_121.c index c430d46..cb121ee 100644 --- a/Linux_C_12/cpicture_121.c +++ b/Linux_C_12/cpicture_121.c @@ -1134,37 +1134,17 @@ void WinDrawResizedBitmap (gint sourcew, gint sourceh, gint destx, gint desty, gint destw, gint desth, GdkPixbuf *pixbuf, GdkDrawable *inDraw,
OS ios, GdkDrawable **outDraw, OS *oos)
{
-/* HDC compatibleDC;
- POINT sourcesize, destsize, dest, origin;
- HGDIOBJ prevObj;
-
- sourcesize.x = sourcew;
- sourcesize.y = sourceh;
- origin.x = 0;
- origin.y = 0;
- destsize.x = destw;
- destsize.y = desth;
- dest.x = destx;
- dest.y = desty;
-
- // Create a compatible device context
- compatibleDC = CreateCompatibleDC (hdc);
- if (compatibleDC == NULL)
- rMessageBox (NULL,MB_APPLMODAL,"WinDrawResizedBitmap","CreateCompatibleDC failed");
-
- // Select bitmap into compatible device context
- prevObj = SelectObject (compatibleDC, hbmp);
- SetMapMode (compatibleDC, GetMapMode (hdc));
- DPtoLP (hdc, &destsize, 1);
- DPtoLP (hdc, &dest, 1);
- DPtoLP (compatibleDC, &sourcesize, 1);
- DPtoLP (compatibleDC, &origin, 1);
-
- if (!StretchBlt (hdc, dest.x, dest.y, destsize.x, destsize.y, compatibleDC, origin.x, origin.y, sourcesize.x, sourcesize.y, SRCCOPY))
- rMessageBox (NULL,MB_APPLMODAL,"WinDrawResizedBitmap","StretchBlt failed");
-
- SelectObject (compatibleDC, prevObj);
- DeleteDC (compatibleDC);*/
+ if (inDraw) {
+ gdk_pixbuf_render_to_drawable(gdk_pixbuf_scale_simple(pixbuf, destw, desth, GDK_INTERP_NEAREST),
+ inDraw, theDrawGC,
+ 0, 0,
+ destx, desty,
+ destw, desth,
+ GDK_RGB_DITHER_NONE,
+ 0, 0
+ );
+ }
+
printf("WinDrawResizedBitmap is not implemented\n");
*outDraw = inDraw;
*oos = ios;
|