Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi Rage,
you could try CallCommand() with id 1019951 - calling this should delete all selected objects without deleting their children. Might also do what you're after?
WP.
Hi gogeta,
I'm not sure on ScaleBicubic(), but I noticed in your commented line:
//bitmap->ScaleIt(scaledBitmap, defaultBrightness, true, false);
That last 'false' flag, try changing that to true. If you're scaling in a non-proportional way that should be true (might fix your non 'squeeze' issue).
Do the GeUserArea sections display anything? Or are they just spacers?
A mock-up picture might help others to visualise.
How about a 'global' drag and drop function? So, make separate iCustomGui/GeUserAreas for each section. Then just point each of these to the same function held in the parent dialog? That way you only have to write the main drag/catch routine once, in the parent dialog.
Just a thought.
Hi folks,
I'm wanting to get various CTRL+X key presses in my dialog. I can get keys without the ctrl, and I can get the ctrl without keys, but I can't get any ctrl+key presses. In the dialog's Message() function I've tried variations like:
case BFM_INPUT: { BaseContainer KB; GetInputState(BFM_INPUT_KEYBOARD,BFM_INPUT_CHANNEL,KB); LONG qualifier = KB.GetLong(BFM_INPUT_QUALIFIER,NULL); String input = msg.GetString(BFM_INPUT_ASC,""); }
but none work. They key is always blank if control is pressed.
I've seen a couple of older posts that gave some suggestions, but nothing seemed to work.
Is there a particular way we have to do this? Or does it just not work for our own dialogs?
Thanks @ferdinand, I don't expect you to do everything
But I've reached a point where I've tried everything I can think of. I've spent too long going around in circles at this point. Here's what I'd like to get:
A MultipassBitmap that I can pass to RenderDocument() that will give me
for use with the standard renderer. For now, I must have these 3 layers.
Here's some code I've experimented with to try and show you where I've been:
MultipassBitmap *multi = MultipassBitmap::Alloc(width,height,COLORMODE_RGBf); if(multi) { MultipassBitmap *colourMap = multi->GetLayerNum(0); MultipassBitmap *alphaMap = multi->AddAlpha(nullptr,COLORMODE_GRAYf); if(alphaMap) { alphaMap->SetParameter(MPBTYPE_NAME,String("Alpha")); alphaMap->SetParameter(MPBTYPE_USERID,VPBUFFER_ALPHA); alphaMap->SetParameter(MPBTYPE_SAVE,TRUE); alphaMap->SetParameter(MPBTYPE_SHOW,TRUE); } MultipassBitmap *depthMap = multi->AddAlpha(alphaMap,COLORMODE_GRAYf,FALSE); if(depthMap) { depthMap->SetParameter(MPBTYPE_NAME,String("Depth")); depthMap->SetParameter(MPBTYPE_USERID,VPBUFFER_DEPTH); depthMap->SetParameter(MPBTYPE_SAVE,TRUE); depthMap->SetParameter(MPBTYPE_SHOW,TRUE); } if(RenderDocument(doc,rdata,nullptr,nullptr,multi,RENDERFLAGS_0,nullptr) == RENDERRESULT_OK) { ShowBitmap(multi); } }
I've tried all sorts of variations of this, none of which produce the same as the Render to Picture Viewer command. Which is why I mentioned having that as an example would be useful.
How do we do this?
Sorry folks, I keep spamming my topic! I've realised there's another issue. AddLayer() returns NULL, and from a topic I made previously (some time a go now) it was reported as a bug, but it's never been fixed by the looks of it.
How can I add layers to a MultipassBitmap!? How does the command Render to Picture Viewer do it?
edit by @ferdinand : Forked from Render settings Multi-Pass flag. Please open new topics for new questions, your follow up questions were too broad to be put into the same topic.
I may have resolved this. It seems like I have to use SetParameter() with the flags MPBTYPE_USERID and VPBUFFER_DEPTH. This wasn't clear in the docs (my docs at least).
Just a suggestion, it might be useful to have an example reference somewhere of how to setup a MultipassBitmap for rendering with all the layers needed as per the render settings. Something like how the Render To Picture Viewer button might do it behind the scenes.
I have a follow-up question to this. I can't see the link between making a MultipassBitmap (MPB) and having a depth matte render.
For example; when I hit the render button, it renders with a depth matte and it displays in the picture viewer. But if I do it myself (C++) using the same render settings, I don't get any depth matte. I'm guessing it has something to do with setting up layers in the MPB. But I can't see how this is done. I know how to make a layer. But I don't know how to say "this layer is for the depth matte".
For however it's done, is there an example of this somewhere?
Thanks @ferdinand,
Didn't see the enable flag in the header file, needed to look a bit more! For anyone else, this flag needs to be set with SetParameter().
Flag is turned on, thanks again.
How does one turn on the Multi-Pass option in the render settings? This one:
Sounds like what I'm doing should be OK then. If I run into any problems, I'll pop back in for further advice.
Thanks @ferdinand, your help is always appreciated. We can close this one.
@ferdinand said in GeClipMap and init(BaseBitmap):
Starting or stopping drawing operations for CA will have no impact on CB and vice versa
This might be the answer. But just to be sure...
The docs say that to use both Get/SetPixelRGBA() they have to be enclosed in BeginDraw/EndDraw(). So if we're handling two clip maps at the same time, for example reading from one and writing to another, can they both be 'active' between Begin/EndDraw() at the same time?
In my case, something like this:
/* pseudo code */ GeClipMap *CA = GeClipMap::Alloc()... // init CA etc. We'll draw text into this one GeClipMap *CB = GeClipMap::Alloc()... CB->init(bmp); // init this one with another Bitmap CA->BeginDraw(); CB->BeginDraw(); /* Add some text into our first clip map */ CA->SetColor(...); CA->TextAt(...); /* 'for' loop here to iterate over CA, and copy into CB if colour from CA is not black */ LONG r,g,b,a; for(int rows = 0; etc...) { for(int cols = 0; etc...) { /* Get rgba from CA */ CA->GetPixelRGBA(....); /* Check if red colour is greater than 0 */ if(r != 0) { /* Set/blend pixel colour into CB */ CB->SetRGBA(...); } } } CA->EndDraw(); CB->EndDraw();
In this case, we have to use GetPixelRGBA on the first clip map with the text, and are using SetPixelRGBA on the second clip map that's the BaseBitmap we're adding text into. They'd both be between Begin/EndDraw() at the same time in my example above. Is this OK?
For what it's worth, it seems to work in my plugin. But I want to check that it's safe to do.
OK, I had to jump through some hoops for one solution here.
I created a separate GeClipMap, just the size of the text width and height. I added the text into this in a white colour. I then iterated over this text map and if the pixel was greater than black, I blended it in with the main clip map and the text colour needed. Not an ideal solution as it involves creating another temporary clip map, but they're only the size of the text so fairly small.
While I'm on this one, is it safe to have two clip maps inside the BeginDraw() and EndDraw() functions at the same time?
Leave it with me @ferdinand, I'll dig a bit more tomorrow and over the weekend, and if no luck I'll get back to you (or I'll try a different drawing method).
I'll let you know.