I just started to WP7 Dev, and I would like a bit of help on solving this:
I have a Canvas in wich I have 2 StackPanels where I draw like 10 Rectangle. So my question is, how do I save the canvas to a Bitmap?
here is what I want to achieve, that from this:
I get this:
Any help that points me in the right direction would be much appreciated.
What you want to do is to create a WriteableBitmap and then call it's Render method with the UIElement you want to render to it.
Related
I want to create program to zoom and displacement a context of photo. Something like in Google Maps - when I clicked on map and move mouse the content of map is changing. I want the same result in my program. Zoom works good for me. How can I solve that? For now I have a program to move all image not only context of this...
Thanks for helps!
Hi Stackoverflow community !
Is there any way to render only objects (Panels, Images...) that are "inside" the canvas.
I thought about using objects' position to see if they're inside the canvas rectangle, but the best would be to also render objects partially when a part of them is inside the canvas.
Like if the canvas was used as a "mask" of visibilty.
Thank you in advance every one ! :)
OuiMerci.
As Stud pointed out, there's an easy to use "Mask" component made for the UI system that works like a charm. :)
Hello, I'm trying to create a rotation animation on a button between 2 images one for the and another for the front, just like what's happening in tiles.
Any ideas please?
thanks
Very similar to this thread. Check out Tile Slider or Hub Tiles. Alternatively, you could create your own animations.
I want to display an image in a QGraphicsView with a QGraphicsScene. My code is very basic :
QGraphicsScene* scene = new QGraphicsScene(this);
scene->addPixmap(QPixmap(qApp->applicationDirPath() +"/france.gif"));
ui->myGraphicsView->setScene(scene);
ui->myGraphicsView->fitInView(scene->sceneRect());
My problem is that my picture has a wrong size. It is very small, with wrong proportions and on the center of my GraphicsView. With qDebug i kwow that my picture is load successfully and it has a size of about 100x800px. My graphicsView is smaller so i want to resize my picture to adjust it with my GraphicsView size.
The graphicsView is set in the mainwindow Form and the scene is declared in the header : "QGraphicsScene scene;"
I try everything is possible in the world (i think) but the graphicsView is alaways blank or contains the small version of the picture. When I copy/paste some codes of internet i always get this problem. I also try with this example : Qt GUI Development - Displaying a 2D grid using QGraphicsView , same problem...
Maybe i'm very very very tired but i really don't understand what is wrong. Help me please :)
sceneRect() may not be what you think it is unless you specifically set it. Also you are missing aspectRatioMode in fitInview call which can distort it image, sometimes resulting in "small" appearance.
QGraphicsScene* scene = new QGraphicsScene(this);
QGraphicsPixmapItem p = scene->addPixmap(QPixmap(qApp->applicationDirPath() +"/france.gif"));
ui->myGraphicsView->setScene(scene);
ui->myGraphicsView->fitInView(p, Qt::KeepAspectRatio);
From my experience, a shown image is very small if we try to fitInView before the scene window is displayed. Technically, the sceneRect size is not set in the way we want until it is actually shown. Therefore, we need to let the scene window shows up before we can properly use fitInView.
Well, I think the solution is available here
Qt5 C++ QGraphicsView: Images don't fit view frame
I am using Flash CS5 and trying to make a movie clip scrollable inside a rectangle mask.
I have tried different codes but it doesn't seem to assume the movieclip as the scrollable area and the rectangle as the mask.
I'm very new to this, there is probably an obvious solution.
Please help!
The link http://www.kirupa.com/developer/flash8/scrollbar.htm has a tutorial for scroll movieclip. I thing this tutorial will help you.