-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitmapObject.as
More file actions
34 lines (25 loc) · 845 Bytes
/
BitmapObject.as
File metadata and controls
34 lines (25 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef mod_BitmapObject
#include "gdi32.as"
#module mod_BitmapObject
#defcfunc CreateDDB int _x, int _y, int _width, int _height,\
local hdcDisplay,\
local hbitmap,\
local hdcDib
hdcDisplay = CreateDC("DISPLAY", 0, 0, 0)
hbitmap = CreateCompatibleBitmap(hdcDisplay, _width, _height)
hdcDib = CreateCompatibleDC(hdcDisplay)
SelectObject hdcDib, hbitmap
BitBlt hdcDib, 0, 0, _width, _height, hdc, _x, _y, SRCCOPY
DeleteDC hdcDisplay
DeleteDC hdcDib
return hbitmap
#defcfunc CreateDIB int _x, int _y, int _width, int _height,\
local hbitmap, local hdcMemory
hbitmap = CreateCompatibleBitmap(hdc, _width, _height)
hdcMemory = CreateCompatibleDC(hdc)
SelectObject hdcMemory, hbitmap
BitBlt hdcMemory, 0, 0, _width, _height, hdc, _x, _y, SRCCOPY
DeleteDC hdcMemory
return hbitmap
#global
#endif