Hi,
My custom gui button has a width and height of 100 (i.e. should be square). The images are also in 100x100 dimension. But as you can see there are unwanted margin making it a portrait.
You can see the problem here:
https://www.dropbox.com/s/zo198h5b34igh3o/c4d191_unexpected_margin_on_custom_gui_button.jpg?dl=0
This is the code with the AddCustomGui
:
sample_bmp = c4d.bitmaps.BaseBitmap()
sample_bmp.InitWith(sample_img)
bcBitmapButton = c4d.BaseContainer()
bcBitmapButton[c4d.BITMAPBUTTON_BUTTON] = True
buttonId = 2000
w = 100
h = 100
self.GroupBegin(id=9001, flags=c4d.BFH_SCALEFIT, groupflags = c4d.BFV_GRIDGROUP_EQUALCOLS | c4d.BFV_GRIDGROUP_EQUALROWS, cols=4, rows=4,initw=0, inith=0)
for image in images: # iterates for every image in the image folder
image_bmp = c4d.bitmaps.BaseBitmap()
image_copy = os.path.join(image_path, image)
image_bmp.InitWith(image_copy)
# bitmapButton = self.AddCustomGui(buttonId, c4d.CUSTOMGUI_BITMAPBUTTON, "", c4d.BFH_CENTER|c4d.BFV_CENTER, w, h, bcBitmapButton)
bitmapButton = self.AddCustomGui(buttonId, c4d.CUSTOMGUI_BITMAPBUTTON, "", c4d.BFH_FIT|c4d.BFV_TOP, w, h, bcBitmapButton)
bitmapButton.SetImage(image_bmp, True)
self.GroupEnd()
Thank you for looking at my problem