Hello,
Is it possible to rotate a GeClipMap? I am drawing a rectangle like so...
import c4d
from c4d import gui,bitmaps
GADGET_ID_GEUSERAREA = 10000
def drawColorBitmap(w,h,r,g,b):
r = int(r * 255)
g = int(g * 255)
b = int(b * 255)
bmp = bitmaps.BaseBitmap()
bmp.Init(w, h, 24)
for wPixel in range(w):
for hPixel in range(h):
bmp.SetPixel(wPixel, hPixel, r, g, b)
return bmp
class MyUserArea(c4d.gui.GeUserArea):
bitmapWidth = 25
bitmapHeight = 25
def DrawMsg(self, x1, y1, x2, y2, msg):
baseBmp = drawColorBitmap(x2,y2,0.35,0.35,0.35)
drawMap = bitmaps.GeClipMap()
drawMap.InitWithBitmap(baseBmp, None)
drawMap.BeginDraw()
drawMap.SetColor(255,0,0,int(240))
cX = int(self.GetWidth()/2)
cY = int(self.GetHeight()/2)
drawMap.FillRect(int(cX-self.bitmapWidth),
int(cY-self.bitmapHeight),
int(cX+self.bitmapWidth),
int(cY+self.bitmapHeight))
drawMap.SetDrawMode(c4d.GE_CM_DRAWMODE_BLEND,
c4d.GE_CM_SRC_MAX_OPACITY)
drawMap.EndDraw()
bmp = drawMap.GetBitmap()
self.DrawBitmap(bmp,
x1, y1, x2, y2,
0, 0, bmp.GetBw(), bmp.GetBh(),
c4d.BMP_NORMAL | c4d.BMP_ALLOWALPHA)
class ExampleDialog(c4d.gui.GeDialog):
geUserArea = MyUserArea()
def CreateLayout(self):
self.SetTitle("ClipMap")
self.AddUserArea(GADGET_ID_GEUSERAREA, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 100, 100)
self.AttachUserArea(self.geUserArea, GADGET_ID_GEUSERAREA)
return True
def main():
dlg = ExampleDialog()
dlg.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, defaultw=300, defaulth=50)
if __name__=='__main__':
main()
Thank you.