@wickedp Wow! I can't believe I missed this point. Thanks a lot WP .
I changed the flag and it worked.
Thanks Again !
Latest posts made by gogeta
-
RE: Scaling of image not working
-
Scaling of image not working
Hi,
I want to scale down my image by 50% of its original width. For example, if I have an image of resolution 1366x768 then the resultant image should be of 683x768 resolution. I am drawing the bitmap image in GeUserArea using DrawBitmap().
For scaling, I have used bitmap->ScaleIt() and bitmap->ScaleBicubic() functions but no luck. The ScaleIt() function scales the image but not the object in it. The object looks exactly as it was in original image but what I want is the image should look like squeezed i.e. scaled down by 50% in width. The ScaleBicubic() is now working at all. Although my destination image is of small size than of source image, it is still not working. Please help me with this. Below is the source code that I am using:// create new bitmap AutoAlloc<BaseBitmap> scaledBitmap; if (scaledBitmap == nullptr) return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION); // get source bitmap dimensions const Int32 originalWidth = bitmap->GetBw(); const Int32 originalHeight = bitmap->GetBh(); // initialize new bitmap with half width of the size const Float scale = 0.5; const Float scaledWidth = originalWidth * scale; const Float scaledHeight = originalHeight; const IMAGERESULT result = scaledBitmap->Init((Int32)scaledWidth, (Int32)scaledHeight); if (result != IMAGERESULT::IMAGERESULT_OK) { return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION); } // fill new bitmap with scaled content of the source bitmap const Int32 defaultBrightness = 256; //bitmap->ScaleIt(scaledBitmap, defaultBrightness, true, false); bitmap->ScaleBicubic(scaledBitmap, 0, 0, originalWidth, originalHeight, 0, 0, scaledWidth, scaledHeight); ShowBitmap(scaledBitmap); DrawBitmap(scaledBitmap, x, y, scaledWidth, imageHeight, 0, 0, scaledWidth, scaledHeight, BMP_NORMALSCALED);
Thanks in advance!
Edit a_block: Added code tags.
-
RE: SetPercent() not working...
@m_adam Hi,
Thanks for your answer. I applied your changes and it worked like a charm .
Thanks again!!! -
RE: SetPercent() not working...
@mp5gosu Hi,
I can't provide you the exact code but I am providing some portion of code for understanding. Please have a look into this.
Bool ProgressBarDialog::CreateLayout() { return ProgressDialog::CreateLayout(); } Bool ProgressBarDialog::InitValues() { GePrint("Initializing progress bar values."); //percentIncrease = 0.0F; //this->SetTimer(1000); return ProgressDialog::InitValues(); } void ProgressBarDialog::Main(C4DThread *bt) { percentIncrease = 0.0F; GePrint("In Main function."); Bool status = false; /*some variables*/ ... ... ... String str1; String str2; /*Set progress bar 10%*/ SetPercent(0.1f); DWORD flag = doSomework(); status = readStatus(arg1,arg2,arg3); if (!status) { MessageDialog("Please Try Again. Facing Issue !"); isErrorOccurred = true; return ; } /*Set progress bar 20%*/ SetPercent(0.2f); //StatusSetBar(10); /*some relevant tasks*/ /*Set progress bar 30%*/ SetPercent(0.3f); status = doSomeCommunication(buff1, buff2); /*Set progress bar 60%*/ SetPercent(0.6f); if (!status) { /*Set progress bar 70%*/ SetPercent(0.7f); /*Perform other tasks*/ /*Set progress bar 80%*/ SetPercent(0.8f); } else { /*Set progress bar 70%*/ SetPercent(0.7f); status = doSomeParsing(Buff1, &var1); if (!status) { MessageDialog(buff[0]); //display error msg isErrorOccurred = true; return ; } /*Set progress bar 90%*/ SetPercent(0.9f); /*do some other tasks*/ } /*Set progress bar 100%*/ SetPercent(1.f); } void ProgressBarDialog::Timer(const BaseContainer &msg) { GePrint("ProgressBarDialog::Timer() is called."); GePrint("value of percentIncrease = " + String::FloatToString((percentIncrease))); percentIncrease += 2.0f; SetPercent((Float)percentIncrease / 100); }
Thanks!
-
RE: SetPercent() not working...
Hi,
I tried the same as suggested by you but it still didn't work .
I even tried with hardcoded float values but still no progress.
I am not able to understand why is this happening .Update: In Main() function of ProgressDialog class I am doing some task and also updating the progress bar with SetPercent(0.1F), SetPercent(0.2F) and so on.
Please guide me.Thanks.
-
SetPercent() not working...
Hi,
I am using ProgressDialog() class to show the progress bar in my plugin. I got the example from here.
This example works fine and shows a good progress bar but when I customized it to use for my code it stopped showing the progress percentage which was set using SetPercent().
Here is my code :void ProgressBarDialog::Timer(const BaseContainer &msg) { GePrint("ProgressBarDialog::Timer() is called."); GePrint("value of percentIncrease = " + String::FloatToString((percentIncrease))); percentIncrease += 2.0f; SetPercent(percentIncrease/100); }
Also if I am using the SetPercent() in *void ProgressBarDialog::Main(C4DThread bt) function of ProgressDialog(), it is still not working.
Please help me with this as I am stuck with it for a long time.
Thanks In Advance.
-
RE: Drag GeUser Area Dialog window which is in DLG_TYPE_ASYNC_POPUPEDIT mode
@a_block Hi Andreas,
Thanks a lot for the reply. I tried to use the DLG_TYPE_ASYNC_POPUP_RESIZEABLE mode for the dialog but couldn't get the desired result as well. Is there a way to maximize the window with the same mode so that there will be no window bar or menu bar?Thanks !
-
Drag GeUser Area Dialog window which is in DLG_TYPE_ASYNC_POPUPEDIT mode
Hi team,
I want to drag the GeUser area in a dialog window from one place to another (say from one monitor to another). The problem is I have created the GeUser Area in a dialog window which is created using DLG_TYPE_ASYNC_POPUPEDIT dialog type.
So I am having the user area full screen without any title bar or menu bar. But the problem is, now I am not able to drag the dialog window from one place to another place or can't even move the window. The only right click of mouse button seems to work. I used various methods for dragging using HandleMouseDrag() and even MouseDragStart() & MouseDrag() functions but no luck .Is there any way to drag the dialog window in DLG_TYPE_ASYNC_POPUPEDIT mode from one place to another?
I can't change the dialog type from DLG_TYPE_ASYNC_POPUPEDIT to anything else as it is the requirement of the plugin. Please help me with this as I am stuck in this.
Thanks in advance.
-
RE: Want to show text in dialog box similar to "Help" menu of Cinema 4D(only text)
@s_bach Wow! I didn't see that coming. Thanks for the clear-cut explanation. Now I know in which direction I have to move. Thanks again !
-
Want to show text in dialog box similar to "Help" menu of Cinema 4D(only text)
Hi,
I was wondering if I can draw text similar to the text in "Help" section of Cinema 4D?
I want to draw only the text similar to that of the help section. I tried with GeUserArea and GeClipMap. But I couldn't make the text look similar or function similar to that of help section (in terms of Font, font size and other formattings). Is there a way to achieve this ?Thanks In Advance.