I have a zest(1.5.0) graphViewer which is quite large as a result scrollbar appears in the composite.
Now when I am trying to export this graph as a png I am getting only the visible portion of the graph.Region beyond the scrollbars is not available in the image.
Image image = new Image(PlatformUI.getWorkbench().getDisplay(), composite.getBounds().width, composite.getBounds().height);
ImageLoader loader = new ImageLoader();
GC gc = new GC(image);
composite.print(gc);
gc.dispose();
loader.data = new ImageData[]{image.getImageData()};
loader.save("c:/raja/graph.png", SWT.IMAGE_PNG);
If I use graphViewer object it gives nodes collapsed on the top left corner
GC gc = new GC(viewer.getGraphControl());
Rectangle bounds = viewer.getGraphControl().getBounds();
Image image = new Image(viewer.getGraphControl().getDisplay(), bounds);
**<Rest same as above code>**
I need to get a single image with complete graph in it.Is there a way to achieve this.
I think animation could be causing the clustering of nodes in second approach.Is there a way to turn it off (I tried setting nodeStyle to ZestStyle.No_Animation_Layout but it did not help the cause).
Printing/drawing into the image is no different from printing/drawing on the display. You need to actually draw everything, what should be displayed. We had similar requirement for printing Ghantt Chart. You can download the source code and check how printing is supported there.
The idea is that you need to control drawable area and draw all the objects one by one there and then start drawing next page. I'd say it is not the easiest task, as it usually requires lots of calculations to support different printing settings.
In your case I don't know if you have control over the source code to support such functionality, so may be it would be possible to emulate it by programmatically scrolling your graph and drawing it at the same time, using composite.print(gc). However, this might introduce bad user experience.
There are also some frameworks, like PaperClips to make your printing little bit easier. There are also some swing libraries, which could be integrated into your Eclipse RCP. Also, please see this SO question for more details.
Hope that this could give you some ideas.
Related
I'm just getting started with Mono programming using GTK, and have been pleasantly surprised. However, I have come across a hurdle I haven't been able to get over yet.
In the app I'm working on, I am able to load a JPEG image into a Pixmap and draw it to my GUI's Drawing Area. That works fine. However, I want to be able to take a second JPEG image, make it partially transparent, and draw it over the first. So far, I haven't been able to figure out a decent way to do this.
Is it somehow possible to change the alpha value of an entire Pixmap before I draw it? I'm not sure where to go from here.
If you're using GtkDrawingArea you should be using Cairo to do the drawing itself. As an alternative to using cairo_paint() there is a cairo_paint_with_alpha() which lets you specify the opacity you wish to paint with.
I'm making cuts of an image to use in various parts of my website; The header, the footer, etc. When I copy and paste to a new layer, it leaves a "feathered" edge. even though I have this set to zero. There is a 1 pixel margin around all of the copy and pasted images, that, when assembled as a web page using CSS, leaves little lines between all of the images. I was a professional graphic designer but I've been out of the game too long (2 whole years). God help me.
I'm not 100% sure of the source of the initial assets such as the header and footer, so I'm a little confused (some links might be nice), however it is worth checking a few things just to make sure. Hit M for the marquee and check thats feather amount. L for the lasso (long shot) and check that too, also check for any layer styles.
A nice little alternative, if you are exporting out individual assets,is go to File > Scripts > Export Layers to Files. This may save you a lot of trouble in the long run.
Hopefully this may help...
Additionally how are you copying? Is it from inside Photsohop or are you placing the layers? Are you using the marquee tool?
for try, don't use crop tool.. use select tool instead. select tool provides pixel level accuracy.
In addition to feather, try turning off anti-aliasing in your selections. After you make a selection, in the select options toolbar uncheck 'Anti-alias'.
If this is set photoshop will try to average the edges of the selection with the surrounding pixels to make it 'blend' better. This is worse than useless if you're trying to make accurate, pixel-level selections.
In Photoshop CC, after selecting with the marquee tool, right click to access the Feather option. Enter 0.1 and then copy and paste. That should take care of it.
I just encountered this problem. I'd cut and pasted and then dragged into a new image which created a new layer with the paste on. I then realised that the feathering was wrong. I changed the settings but forgot to change the active layer back to the background layer, so I was cutting and pasting the feathered cut I did originally. Facepalm.
I'm completely newbie to Qt
i want to create a 800X600 window that just show some circle and be able to manipulate pixels of the form. there is no interaction between user and form(no click, no dblclick,...) it just shows some circles with one color and lines with different pixel colors(each line may have different pixel colors)
also i want to be able to change the coordination system, i mean change it from top-left to the center of the window. could anyone help me do that with some sample code?
thanks in advance for your reply.
Please try downloading the Qt Creator (IDE), then reading through the tutorials. There's a whole host of very useful information provided for free, including a lot of the code samples you are looking for.
The following examples might also be of particular interest:
Animation Framework Examples
Graphics View Examples
Painting Examples
I have an image with picture of a person and I want to let the user to pick some area of the person and change the color. But how can I best create a multi-mask image?
E.g. should the user be able the change the color for a leg or a hand.
I am using Titanium Appcelerator, and right now I had a solution with buttons placed over the image, which is not a pretty and accepted solution.
The Kitchensink example, has only one area which can be changed.
The only solution I found for working with sections of an image is to divide the image into different views then use a vertical or horizontal view to glue them together. Sounds like you took a similar approach using buttons.
Another option might be to use one of the jQuery image libraries within the webview. This most likely will have a performance penalty though.
Ok, narrow question of the day. I'm using GflAx (from xnview) to create some graphic tiles. I would like to put some gradients in as well though.
Is there a way I can do this within this product?
There is also an SDK which is part of this product but I can't find that info there.
You can not do this but you can create the gradient in another program and then do a "LoadBitmap" make the mods you need ontop of that 'background' and then save to a new file.