Deflation Animation not Working

Hi,
I have got a code from this forum which create a ellipse on the client area. First it creates a rectangle equivalent to the size of client area. I have put the deflation code in the ::OnTimer( ....) but its not working.
void CTestingCode1View::OnDraw(CDC* pDC)
CTestingCode1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
GetClientRect(&rect);
//CRect rc(rect.TopLeft().x+10, rect.TopLeft().y+10,rect.BottomRight().x-10,rect.BottomRight().y-10);
//CDC *pDC = GetDC();
CDC WorkDC;
CBitmap memBmp, * pOldMemBmp;
WorkDC.CreateCompatibleDC(pDC);
memBmp.CreateCompatibleBitmap(pDC, rect.Width(), rect.Height());
pOldMemBmp = (CBitmap *)WorkDC.SelectObject(&memBmp);
int oldBkMode = WorkDC.SetBkMode(TRANSPARENT);
WorkDC.Ellipse(rect);
WorkDC.SetBkMode(oldBkMode);
// WorkDC.BitBlt(0, 0, rect.Width(), rect.Height(), pDC, 0, 0, SRCCOPY);
//pDC->BitBlt(0, 0, rect.Width(), rect.Height(), &WorkDC, 0, 0, SRCCOPY);
pDC->BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &WorkDC, 0, 0, SRCCOPY);
WorkDC.SelectObject(pOldMemBmp);
pOldMemBmp->DeleteObject();
// TODO: add draw code for native data here
}void CTestingCode1View::OnTimer(UINT_PTR nIDEvent)
// TODO: Add your message handler code here and/or call default
rect.DeflateRect(10,10);
CView::OnTimer(nIDEvent);
int CTestingCode1View::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1,200,NULL);
//#3016
//@R0
//return -1;
//#3016
//@R0
//#3016
// @R0
// TODO:  Add your specialized creation code here
//@R0
return 0;
CReact is declared as a class variable in *view.h. Some body please guide me.
Zulfi.

Hi my friend,
I am able to calculate the values for initial line like ellipse at the start of inflation process by trial and error process. The values are part of OnDraw(...) method. There is a little bit flicker when the inflation ellipse is maximized.
#include "stdafx.h"
// SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
// and search filter handlers and allows sharing of document code with that project.
#ifndef SHARED_HANDLERS
#include "DefInflate2.h"
#endif
#include "DefInflate2Doc.h"
#include "DefInflate2View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CDefInflate2View
IMPLEMENT_DYNCREATE(CDefInflate2View, CView)
BEGIN_MESSAGE_MAP(CDefInflate2View, CView)
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CDefInflate2View::OnFilePrintPreview)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_TIMER()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
// CDefInflate2View construction/destruction
CDefInflate2View::CDefInflate2View()
// TODO: add construction code here
CDefInflate2View::~CDefInflate2View()
BOOL CDefInflate2View::PreCreateWindow(CREATESTRUCT& cs)
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
// CDefInflate2View drawing
void CDefInflate2View::OnDraw(CDC* pDC)
CDefInflate2Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CRect cr;
int cx, cy;
GetClientRect(&cr);
CDC WorkDC;
WorkDC.CreateCompatibleDC(pDC);
CBitmap memBmp;
memBmp.CreateCompatibleBitmap(pDC, cr.Width(), cr.Height());
CBitmap *pOldMemBmp = (CBitmap *)WorkDC.SelectObject(&memBmp);
CBrush background(0xFF0000);
WorkDC.FillRect(&cr, &background);
if (m_running)
WorkDC.Ellipse(m_rect);
else {
m_running = true;
SetTimer(1234, 50, 0);
GetClientRect(&cr);
if(deflation) {
m_rect.left = 0;
m_rect.top = 0;
m_rect.right = cr.right;
m_rect.bottom = cr.bottom;
else {
m_rect.left = (cr.left+cr.right)/2 -150;
m_rect.top = (cr.top+ cr.bottom)/2;
m_rect.right = (cr.left+cr.right)/2 +150;
m_rect.bottom = (cr.top+ cr.bottom)/2;
//Special Assigned values
m_rect.left = 200;//cr.left;//+cr.right-20;
m_rect.top = (cr.top+ cr.bottom)/2;//cr.bottom/2;
m_rect.right = 100;//0;//cr.left+cr.right+20;
m_rect.bottom = (cr.top+ cr.bottom)/2;//0;//cr.bottom;*/
WorkDC.Ellipse(m_rect);
pDC->BitBlt(0, 0, cr.Width(), cr.Height(), &WorkDC, 0, 0, SRCCOPY);
WorkDC.SelectObject(pOldMemBmp);
// TODO: add draw code for native data here
// CDefInflate2View printing
void CDefInflate2View::OnFilePrintPreview()
#ifndef SHARED_HANDLERS
AFXPrintPreview(this);
#endif
BOOL CDefInflate2View::OnPreparePrinting(CPrintInfo* pInfo)
// default preparation
return DoPreparePrinting(pInfo);
void CDefInflate2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
// TODO: add extra initialization before printing
void CDefInflate2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
// TODO: add cleanup after printing
void CDefInflate2View::OnRButtonUp(UINT /* nFlags */, CPoint point)
ClientToScreen(&point);
OnContextMenu(this, point);
void CDefInflate2View::OnContextMenu(CWnd* /* pWnd */, CPoint point)
#ifndef SHARED_HANDLERS
theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);
#endif
// CDefInflate2View diagnostics
#ifdef _DEBUG
void CDefInflate2View::AssertValid() const
CView::AssertValid();
void CDefInflate2View::Dump(CDumpContext& dc) const
CView::Dump(dc);
CDefInflate2Doc* CDefInflate2View::GetDocument() const // non-debug version is inline
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDefInflate2Doc)));
return (CDefInflate2Doc*)m_pDocument;
#endif //_DEBUG
// CDefInflate2View message handlers
int CDefInflate2View::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
m_running= false;
/*#3016
@R0
return -1;
#3016
@R0
#3016
@R0
// TODO: Add your specialized creation code here
@R0*/
return 0;
void CDefInflate2View::OnSize(UINT nType, int cx, int cy)
CView::OnSize(nType, cx, cy);
m_rect.left = 0;
m_rect.top = 0;
m_rect.right = cx;
m_rect.bottom = cy;
if (!m_running)
SetTimer(1234, 50, 0);
m_running = true;
deflation=1;
start = true;
// TODO: Add your message handler code here
void CDefInflate2View::OnTimer(UINT_PTR nIDEvent)
// TODO: Add your message handler code here and/or call default
CRect cr;
int width= m_rect.Width();
int ht = m_rect.Height();
if (deflation) {
if (width<=0 || ht<=0){
deflation=0;
KillTimer(1234 );
m_running=false;
Invalidate();
else {
m_rect.DeflateRect(1,1,1,1);
Invalidate();
else {
GetClientRect(&cr);
width= cr.Width();
ht = cr.Height();
if (m_rect.Width() >= width || m_rect.Height() >= ht ) {
deflation=1;
KillTimer(1234 );
m_running=false;
Invalidate();
else {
m_rect.InflateRect(1,1,1,1);
Invalidate();
CView::OnTimer(nIDEvent);
BOOL CDefInflate2View::OnEraseBkgnd(CDC* pDC)
// TODO: Add your message handler code here and/or call default
return true;
return CView::OnEraseBkgnd(pDC);
Many thanks for your guidance.
Zulfi.

Similar Messages

  • SWF animations not working properly when exported as PDF from InDesign

    I'm using InDesign CS5 and have created a document that I want to add interactivity and animations to. I've created buttons and page destionations, etc, which all work perfectly  when exported to a PDF but the simple animation that I wanted to include don't work. The animations have been created in InDesign then selection exported as a SWF file and then imported and placed in InDesign and then exported as an interactive PDF where the animations either don't work, haven't been picked up or don not work as they should. What am I doing wrong, how do I get the animations to work correctly?

    Try this tutorial:
    http://tv.adobe.com/watch/csinsider-design/indesign-creating-interactive-pdfs-with-page-tu rn-and-flash-animations/

  • Spry Collapsible Panel animation not working

    I've inserted a spry collapsible panel into a web page and it works fine when I preview it. But when I upload it to the server the animation does not work in both Safari and Firefox (haven't tried any other browsers). The panel is just static, showing the tab and the panel is open showing the content. It is supposed to be closed by default.
    I've added CSS styles but I've also tried it with the default CSS and it didn't work then either.
    Both the .css and .js files that were saved in the SpryAssets folder have been uploaded to the server in the same location as the webpage.
    I'm working on a Mac and CS4.
    URL is www.alpinism.com/New/about.html

    Thanks. That didn't resolve my issues unfortunately and the corrections it was suggesting started interfering with other functions on the page so I've gone back to square one, deleted the Spry collapsible panel and inserted javascript from http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm that does the same thing and seems to work in Safari and Firefox. Just need to check in IE but I expect this is going to be the best solution for me.

  • Adobe Edge .OAM Animation Not Working In ePub Created In InDesign CC

    Hello,
    I am trying to create an ePub that contains video and animations.
    Using Adobe Edge Animation CC, I created an animated chart.  When I tested by previewing it in my browser it worked fine.  I then exported the animation as an .OAM file.
    In InDesign CC, I created my document, imported a .MP4 video and the .OAM animation.  When I test it using the Folio Preview, the video works but the animation does not.  The animation instead acts more like a static image.  When I click on it, nothing happens.  Ideally, the animation should occur once the page is loaded (but I can settle for the animation to happen once clicked).
    Also, I would like to create an Interactive PDF and .MOBI version of this document.  I am a complete noob to this, so any help you can provide would be greatly appreciated.  Thanks.

    Thank you Steve.  I am running InDesign CC 9.2.  I exported an EPUB 3 file and tested it using Firefox's EPUBReader (Since I am experiencing an issue with Readium).  The video is working fine, but the .OAM animated chart does not appear at all.  Do you know what could be causing the .OAM animation not to appear?  Below are some screenshot I grabbed.
    This is how the file looks in InDesign CC.  Circled is the .OAM animation.
    Below is how it looks in EPUBReader.  The .OAM animated chart is missing. (The layout has changed also, but please consider that this is my first ePub that I am creating.  This is all new to me.)

  • Recorded Animations Not Working In Presenter (8.0.1)

    My animation timings are not working when published to Presenter (8.0.1). Narration timing is good, but all the animations simply manifest one after the other, not as I recorded them as I clicked through (and yes each one is set for "click"). I also have the playback option set for "Use PPTX Slide Time"

    It may be related to the the first animation set to with previous. There is a known issue with Presenter when dealing with slides that have a mix of on-click and with/after previous animations:
    Adobe Presenter audio cannot be synchronized correctly with animations if a slide contains a mix of on-click animations and after/previous animations.
    Workaround: For the Adobe Presenter audio to sync correctly, ensure that all animations on a slide are on-click animations.
    The most commonly seen issues with Presenter can be found here: http://helpx.adobe.com/presenter/kb/top-issues-presenter-8.html
    The best option may be to elminate animation elements untill you can identify the one that is causing the issue. I suppose it could be something like the object that is animated (I've seen non JPEG/GIF images do odd things) is not converting to Flash properly. I don't believe it is the animation, as the fade-in animation has worked for years.

  • Non-loop animation not working.

    I am developing a video game for my flash class. This code is not working:
    public function onEvent(e:Event){
    if (constrictMovement){
         bear.gotoAndStop("power");
    if (bear.bearP.currentFrame >= bear.bearP.totalFrames){ // the biggest error is here?
         constrictMovement = false;
    bear is already a variable to a "parent" symbol, containing three "child" symbols (each play a different animation)
    bearP is the instance name of target symbol within a parent symbol.
    constrictMovement is a switch to prevent keyboard input during the event animation is played.
    Everything works fine except for this code snippet. The animation should only complete one cycle, instead of repeating. The switch, constrictMovement should break the repeats by turning bear.gotoAndStop("power") off and activating other parts of code with a !constrictMovement.
    What am I doing wrong? :/ Any help is appreciated, thanks.

    I tried using the trace, there was no response from the problem area. Is there a workaround for bear.bearP.currentFrame = bear.bearP.totalFrames? Here is the pasted code, with unnecessary parts omitted, hopefully you will be able to understand the logic better:
    package  {
              import flash.display.MovieClip;
              import flash.events.Event;
    public class snowBear extends MovieClip {
                        // Environment & Character Controls
                        var constrictMovement:Boolean;
                        // Scene Assets
                        var bear:bearParent;
                        var levelFinisher:powerUp;
                        var cycleOnce:Boolean;
                        var levelAnnouncer:levelFinished;
                        var afterlevelFinisher:Boolean;
                        public function snowBear() {
                                  cycleOnce = true;
                                  bear = new bearParent();
                                  levelFinisher = new powerUp();
                                  levelAnnouncer = new levelFinished;
                                  addChild(bear);
                                  bear.x = stage.stageWidth / 2;
                                  bear.y = stage.stageHeight / 2 + stage.stageHeight * 0.40;
                                  bear.gotoAndStop("idle");
                                  addChild(levelFinisher);
                                  levelFinisher.x = stage.stageWidth * 2;
                                  levelFinisher.y = stage.stageHeight - bear.height * 0.75;
                                  addEventListener(Event.ENTER_FRAME, perFrame);
                        public function perFrame(e:Event){
                                  if (!constrictMovement){
                                  if (!left && !right){
                                            bear.gotoAndStop("idle");
                                            adjSpeed = 0;
                                  if (levelFinisher && bear.hitTestObject(levelFinisher) && cycleOnce){
                                            constrictMovement = true;
                                            removeChild(levelFinisher);
                                            levelFinisher = null;
                                            cycleOnce = false;
                                            trace("cycle complete");
                                  if (constrictMovement){
                                            bear.gotoAndStop("power");
      if (bear.bearP.currentFrame == bear.bearP.totalFrames){
      constrictMovement = false;
      trace("should function");
                                  if (!cycleOnce){
                                            addChild(levelAnnouncer);
                                            levelAnnouncer.x = stage.stageWidth /2 ;
                                            levelAnnouncer.y = stage.stageHeight * 0.23;

  • Diagram Animations not working

    Hello everyone. Hope you can help. I have a diagram that I
    have imported into Captivate from PowerPoint 2003 and the
    animations will not work. It is a simple pyramid and I have each
    section of the pyramid descending into the slide. It works in
    PowerPoint but when I play the project in Captivate, the pyramid is
    static on the slide with no animation. Any thoughts?

    Hi skeeterkgh and welcome to our community
    Is this Captivate 1, 2 or 3?
    Only Captivate 3 will pull in PowerPoint and retain any
    animation. And even then, you have to be choosy and ensure you have
    the option set properly for it to come into Captivate as an
    animation.
    Cheers... Rick

  • Test Flash Player animation not working in Firefox

    Flash demos at the following link are not working for me on Firefox, but work fine in Chrome & Safari:  Adobe - Flash Player
    I have also gotten an error on Tumblr that Flash wasn't installed. I tested it in safe-mode, when 33.02 was the latest as this is an old problem, & also tested with the latest release version 34.0.5.
    This screenshot shows what i see on the Adobe Flash test page - just this dark red color fill, no animation: http://oi61.tinypic.com/2r5ten6.jpg
    (Same exact image/animation with Flash 16.0.0.235)
    on Chrome/Safari i see this in an animation: http://oi62.tinypic.com/2qdsm13.jpg
    i tried uninstalling Flash using these instructions, rebooted, reinstalled, and no change:
    http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-mac-os.html

    yup, you're right. i just installed Firefox for the first time on an old laptop and the test animation plays fine. I did test it in safe mode though, which disables add-ons and the problem still happened, so it must be a lower level issue.  this is probably causing other problems with Flash for me all over the web. i'll try the uninstall/reinstall first when i have a chance. hopefully that works. if not, then i guess i'll have to create a new profile.
    thanks

  • Looping animation not working with Timeline Action...

    I've used the Timline Actions Panel a few other times to loop animations by just selecting 'Complete' and then using sym.play(0); to return to the beginning - pretty hard to mess up I thought.  I have a new animation where this is just not working at all.  Could there be any other reason this is not working or perhaps something I'm just not looking at? 

    Hey,
    Sure, no problem.  Here's a link a a demo of it: http://www.damon9.com/dev/publish/web/EndofDays.html
    Not sure how much you can see from just that, but inside the Edge comp there's nothing crazy going on.  4 layers, 2 rotating 6 degrees a second, stops at 60 seconds (when it should start back from the beginning).  I've tried the usual Timeline Action sym.play(0); on complete and also just adding a trigger at 60 seconds of sym.play(0);
    Just can't imagine what else it could be.
    Thanks
    Damon

  • PowerPoint 2010 game with animations not working on Macbook.

    I am a tech intern at a middle school in Mississippi.  I have created an interactive Jeopardy game in PowerPoint 2010 for the teachers to use when reviewing the kids for tests.  However, some of my teachers have Macbooks and it's not working for them.  They do have keynote and they've been able to use other PowerPoints that I created for them, however those did not contain animations.  I have a pc, as do over half of the teachers, so I have to create on pc.  Is there a specific way to save the PowerPoints that have animations so that the teachers with macs can use them?  Or is there some other fix I'm overlooking?
    Thanks for helping out guys! 

    Talus,
    I was making sure that everything was setup and detecting correctly and it appears so. It could be that the actual midi port could be bad or not connected correctly. Check the connection and if that yields no results you may consider replacing the midi port expansion connector. We have these available for purchase through our Direct Sales department if you are out of warranty or you can contact us for an RMA if you are in warranty. Our contact information is located on this page:
    http://us.creative.com/support/custsup
    Jeremy

  • Edge animation not working firefox 17,18

    hello,
    when i run adobe edge animation like.
    file:///C:/Documents%20and%20Settings/------/My%20Documents/L_Domain_2_e_5/L_Domain_2_e_5. html
    not working i got this error msg
    Error: TypeError: AdobeEdge.okToLaunchComposition is not a function
    Source File: file:///C:/Documents%20and%20Settings/------/My%20Documents/L_Domain_2_e_5/L_Domain_2_e_5 .html

    It is a scary thing to see the blank page come up after spending hours creating a composition
    Please take this error serious !!
    i took some Pictures of this error with one of adobe samples Link
    In Chrome Canary Standard Mode Version 29.0.1530.2 canary
    In FireFox Standard Mode Version 21
    In FireFox Private Mode Version 21
    With these Errors Adobe Edge Animate Will never get popular, Please Find a Way to fix this problem or Solve it in Adobe Edge Animate 2.0 CC
    Thanks
    Zaxist

  • Edge animation not working on iphone

    Hi I wonder if anyone can tell me why this edge animation is not working on iphone. It works on desktop, and android but not iphone!
    it's in an iframe.
    www.jhurleydesign.com/mobileone-responsive/index.html
    any help gratefully received

    Seeing as there is no answer in this thread, I am assuming you never got an answer on this. Did you figure out the problem?
    I am experiencing the same exact problem with an Edge animation that I placed in a Muse created web site.

  • Edge animation not working good on ipad

    Hallo there,
    I have a problem with my slides on contact viewer on my ipad.
    I imported in every slide a simple edge animation.
    But al the animation are working.
    Here is my problem.
    When I start the animation on slide 1 then is it working. But when I go the the second slide. Then the animation don't work.
    But when I go to the 4th slide then it is working again. I don't really know what is the problem with that.
    Can you guys mabye help me out?
    Greetings,
    Thomas

    There is a limit to how much you can do with this and best practice is to
    not jam too much HTML animation into one article. Do you have a delay set
    for the Edge files? Try .125 seconds.

  • Captivate 7: PowerPoint animations not working when previewed in HTML 5

    I have imported my PowerPoint presentation (pptx) into captivate 7. On two slides, I have an image set to fade 1s after the page opens. (The slide duration is 3s). If I scrub the playhead over the timeline, the image fades as expected, and if I select the 'preview in web browser' option, it works as well. It is only when I select 'preview HTML 5 output in web browser' that the image doesn't fade as expected.
    I have 2 other click boxes on the slide. One is to exit and the other is to download a file. Both are on the timeline for the full 3s. There is nothing else on the slide - what am I doing wrong?

    Hi mary_td,
    HTML5 output will work for PPTX files with High Fidelity checked in PowerPoint Import dialog while importing on Windows.
    It will not work for PPT file as mentioned in your post. You can save your PPT as PPTX if that is the case.
    If you still see the issue. Please mail me the pptx file.
    My Email ID: [email protected]
    Regards,
    Nitin Kumar
    Adobe Captivate Engineering Team

  • Text animation not working

    'm having some issues with some text animation. I'm trying to animate certain text boxes of a slide and not others...it all seems to work when I preview it, but when it comes to actually playing the slide, the animation does not appear. I've tried using the Magic Slide (not sure if that's quite the name) but that doesn't give me the animation options I'm looking for. Any ideas?

    Inspector???
    Yes
    Inspector > Animate > Add an Effect > Magic Move (inspector is the side panel on right)

Maybe you are looking for

  • Error while building the DC for CAF entity services

    Hi all, I am trying to create entity services in CAS and following the following help document from help. http://help.sap.com/saphelp_nw04s/helpdata/en/05/3a0741b5b7ee6fe10000000a1550b0/frameset.htm But While building  I am getting following imports

  • I can't see .MP3 files in a folder?

    Hello, I recently just got a MacBook Pro Retina and I wanted to put all of my music on is (908 songs) but when I added the folder of music to my mac, none of the files show up in the folder. I also tried waiting, thinking maybe it would take a long t

  • How can I convert Binary File to Normal Text File?

    Hi, I need to read a binary file and need to conevrt as normal text file. The binary file contains some number & String (Names) with fixed length. It is the combination of Char, String, Integer, Byte & Single Bit. I used DataInputStream but I didnt g

  • Kernel Panic with Stripes

    I've got a 3 year old 15" macbook pro that went into Kernel Panic with Stripes today. There was nothing plugged in except for a power supply. My wife said it was in sleep mode and then she opened it up and displayed the following screen. /___sbsstati

  • Can't import JPGS

    Just trying to import some jpgs from a scanner. and i get this message on SOME of them, they are typically greyed-out. When i select "All Files" they are blacked in but i get this message. "Import: File error: 1 files(s) recognized, 0 access denied 1