@wickedp Wow! I can't believe I missed this point. Thanks a lot WP .
I changed the flag and it worked.
Thanks Again !
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.
-
RE: Add Hyperlink in user area defined by GeUser Area class
@s_bach Hello Sebastian,
Thanks a lot for clearing my confusion. Now I know what to do. Thanks for the help!
Best Regards
Gogeta -
Add Hyperlink in user area defined by GeUser Area class
HI,
Is it possible to add a hyperlink in user area defined by GeUser Area??
If it is, how can I achieve this?
I am using R19 SDK with C++ for the development.Thanks in advance.
-
RE: Need to change rotation order of camera object
@r_gigante Hi Riccardo,
Sorry for the late reply but I was not able to achieve the same with your code as well. But I did some tweaks with regards to the planes and it is working fine now.
Though I appreciate your help a lot. Thank you guys for the help .Regards
Gogeta -
RE: Need to change rotation order of camera object
@s_bach HI Sebastian,
I tried your suggestion of adding EventAdd() after changing the rotation order but it didn't work. Also, I am sorry I can't show the code to you because of some disclosure issues.
Can you please suggest some other ways to change the rotation order of the camera object?
I am trying to rotate the camera order inside User Area functions.Thanks in Advance.
-
Need to change rotation order of camera object
HI Team,
I am facing a strange issue as I am not able to change the "rotation order" of my camera object from HPB to XYZ or to anything else(for both local and global). I am using cameraObj->SetRotationOrder(ROTATIONORDER_XYZLOCAL); but it is not changing the rotation order of the camera object. It is always giving the same result i.e. default HPB order. I have also used cameraObj->SetParameter(); But no success.
How can I change the rotation order to whatever I want? Please help me.
Thanks in advance.
-
RE: Rotate a bitmap image in portrait mode by 90 degrees
@a_block Thank You so much Andreas !
I would like to try all the suggested approaches and hopefully I'll get my issue resolved (except second option is out of my context as I can't use another application). Third potion seems to be the best suited option and I would like to give it a try.
Thanks Again...! -
Rotate a bitmap image in portrait mode by 90 degrees
Hi Team,
How can I rotate a rendered bitmap image in portrait mode by 90 degrees using C++ APIs?
I am able to render the current document in landscape mode and can see it in picture viewer. Also I am able to render the current document in portrait mode but I want to rotate the portrait mode by 90 degrees so that the portrait mode can be seen in rotated form. For example: I set the resolution for rendering as 1280x720 in landscape mode and 720x1280 in portrait mode. Now when I see the rendered output in portrait mode in 720x1280 resolution, I want this to be rotated by 90 degrees and see it as 1280x720 resolution with rotated mode. Please help me to achieve this.I am using R19 SDK and C++ for development.
Thanks in advance.
-
RE: Render the Object with multiple cameras at the same time
@a_block HI Andreas,
Thanks a lot for your reply. I am implementing the first approach as suggested by you as it seems the most feasible approach to my solution. I'll get back to you if I found any issue.Thanks again
-
RE: Need to render the camera view on a separate preview window in c++
Hi Gigante,
Thanks a lot for your reply. I'll analyze that and will update you on the results. Thanks again ! -
Render the Object with multiple cameras at the same time
HI Team,
Hope you are doing well !
I have one question. Is it possible to render the object for multiple cameras at the same time using C++ SDK ?
What I mean to say is suppose I have 5 cameras pointing to an object. I want to render the output of all the 5 cameras at the same time and view the output in a separate window.
Is this possible? If possible, how can I achieve this using C++ SDK ?
I am using R19 SDK and C++ language for development purpose .Thanks in advance.