MFC:Frame region is not working in GDI+

Hi,
I created a dialog of polygon region, and trying to draw the frame around the dialog. I am able to achieve it using CDC::FrameRgn.
But if i want to achieve the same using GDI+, i am not able to do it. I used DrawPolygonPath, but i am seeing the border only in left and top of the dialog. I have attached the my code below. Please help me how to frame the dialog using GDI+.
CPoint vertex[4];
BOOL CPolygonDlg::OnInitDialog()
CDialogEx::OnInitDialog();
ModifyStyle(WS_CAPTION,0);
ModifyStyle(WS_BORDER,0);
CRect rect(400,200,900,700);
CRect wr = rect;
AdjustWindowRect( wr, 0, FALSE );
MoveWindow(wr);
GetClientRect( rect );
CRect csr = rect;
ClientToScreen( csr );
vertex[0] = CPoint(rect.left,rect.top);
vertex[1] = CPoint(rect.right,rect.top);
vertex[2] = CPoint(rect.right,rect.bottom);
vertex[3] = CPoint(rect.left,rect.bottom);
m_rgnShape.CreatePolygonRgn( vertex, 4, ALTERNATE );
m_rgnShape.OffsetRgn( CPoint( csr.TopLeft() - wr.TopLeft() ) );
SetWindowRgn( (HRGN)m_rgnShape.Detach(), TRUE );
m_rgnShape.CreatePolygonRgn( vertex, 4, ALTERNATE );
return TRUE; // return TRUE unless you set the focus to a control
#define USING_CDC
void CPolygonDlg::OnPaint()
CPaintDC dc(this);
#ifdef USING_CDC
CBrush *pBrush = new CBrush(RGB(255,0,0));
dc.FrameRgn(&m_rgnShape,pBrush,1,1);
#else
Graphics graphics(dc.m_hDC);
GraphicsPath gp;
Point point[4];
point[0] = Point(vertex[0].x,vertex[0].y);
point[1] = Point(vertex[1].x,vertex[1].y);
point[2] = Point(vertex[2].x,vertex[2].y);
point[3] = Point(vertex[3].x,vertex[3].y);
gp.AddPolygon(point,4);
Pen pen(Color(255, 255, 0, 0));
graphics.DrawPath(&pen, &gp);
#endif
Thanks
 

Hi ,
I think i found the issue.
I have applied the offset for the region as below and using that region for CDC ::FrameRegion. So its working.
m_rgnShape.OffsetRgn( CPoint( csr.TopLeft() - wr.TopLeft() ) );
So now my question is, how to frame using GDI+ by taking the same region. or is there any other way

Similar Messages

  • Cross-frame scripting is not working in Safari 3.0.4. Minimal example code.

    Hello,
    I've found that cross-frame scripting is not working in Safari 3.0.4, as it worked
    ok on Safari 3.0.1, and in other browsers I tried: Firefox, Mozilla, IE.
    document.domain property is set to "ds2ps.net", correctly to the best of my knowledge
    in the frameset and in both frames. Both frames and frameset are loaded
    from subdomains of the same domain "ds2ps.net"
    Please have a look at this mimimal example:
    http://frameset.ds2ps.net/frames-test/frameset.html
    Press buttons to get alert with value of a variable defined in the frameset
    and in the first frame.
    This gives "undefined" in Safari 3.0.4, and give following message in Safari
    JavaScript console:
    Unsafe JavaScript attempt to access frame with URL http://frameset.ds2ps.net/frames-test/frameset.html from frame with URL http://frame2.ds2ps.net/frames-test/frame2.html. Domains, protocols and ports must match.
    Works ok in all other browsers and in earlier versions of Safari.
    Apperently, I'm doing something incorrectly.
    I would appreciate if Apple Safari developers have a look at this problem and suggest solution.
    My company is developing web application which depends on cross-frame scripting,
    and we would like to continue supporting Safari browser.
    Thank you,
    John

    Thank you, iBod,
    We've submitted this bug at http://bugs.webkit.org
    Bug 16444: Cross-frame scripting not working in Safari 3.0.4 despite proper document.domain set in all frames
    Thank you for your suggestion!

  • Scrollable frames. Buttons not working.

    Hello.
    I have a problem with buttons in the scrollable frames.
    I have a slideshow with a thumb's. Each thumb consist of MSO (non active icon and active icon) and clear frame - button to that MSO and to slide foto. The thumb's grouped and placed into the frame with horizontal scroll overlay effect.
    That frame placed into another frame-pull out tab, which have vertical scroll effect. And when I pressed the button, slide fotos changes correctly, but button MSO not working.
    See files from dropbox --  https://www.dropbox.com/sh/rsbf1jto3a39jug/IVcQxaYJOW
    Sorry for my english. I need help very much.
    Thanks.

    Hi,
    I understand that I can use two 'states'  of the buttons. And I tried it. But. Buttons renditions are raster images. And on the retina display we had bad quality. My target was to create vector buttons. With good quality on both displays.
    Any suggestions?
    04.10.2013, в 12:03, Christophe_Quinzoni <[email protected]> написал(а):
    Re: Scrollable frames. Buttons not working.
    created by Christophe_Quinzoni in Digital Publishing Suite - View the full discussion
    Hi (again),
    It seems that you built your stuff in a very complicated way.
    First, try to make simple!
    You mixed MSO and buttons functions. Useless and unfonctional.
    Yous should use only button panel, with two different 'states' ('Normal' and 'Clic').
    See below (no MSO function used at all for the button):
    http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5735625-468602/445-605/Button_ 1.jpg http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-5735625-468603/448-605/Button_ 2.jpg
    Use the layer panel to easily select the objects you want to modify.
    Please find your file here: https://dl.dropboxusercontent.com/u/46115208/slideshowButton.indd
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5735625#5735625
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5735625#5735625
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5735625#5735625. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Digital Publishing Suite at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • DVCPRO HD Frame rate converter not working

    Hello all
    I cant seem to get my frame rate converter to work. I shot the footage on my hvx200 at 720p30 and then put it in film mode and changed the frame rate to 60. Then I log and transfered it into FCP and when i go to convert it i keep getting the same message.
    www.okayyellow.com/errormessage.png
    does anyone know why? I have gotten some footage to convert before with no problems.
    Thanks
    Andrew

    Evening Films wrote:
    All worked well last time I did this (late March), but upgraded to Leopard since then and brought all FCStudio apps up to date at the same time.
    Looks like on import (log/transfer in FCP from Firestore) somehow the files are being flagged as having 'temporal compression', which can't be true if they're DVCPRO-HD, can it? Anyway the 'temporal compression' seems to be blocking the conform in CT, as well as the DFCPRO FRC in FCP.
    So I tried importing the files from the Firestore thru an older version of FCP (5.1.4) that I have on my PowerBook (the problems described above are on my Mac Pro). I then copied these files out of the capture folder over to the Mac Pro, and sure enough: no problems with 'temporal compression'. The files were all marked as "maximum quality" and were allowed to be conformed from 60 to 24 in CTools, and have dupl frames removed using the FRC as needed.
    So something appears to be broken with FCP 6.0.3 and how it imported this particular set of files on the Firestore.
    I should note that if I hadn't tried to conform or FRC these files, I might never have noticed that there was a problem - they behaved as normal 720/60 files when just viewing them.

  • Aggregate Function in a report region does not work.

    I have a Reports Region with a Region Source that contains an aggregate function. But when I run the page, the value of the function is not returned. I suspect it is a simple syntax error. can somebody tell me what is wrong with
    select "TAG_PERIOD_START_DATE", MIN("ORDER_NUMBER")
    from "#OWNER#"."TAG_ORDER"
    group by "TAG_PERIOD_START_DATE"
    order by "TAG_PERIOD_START_DATE"
    The problem is probably with the MIN("ORDER_NUMBER") part. I tried several versions of that, but none worked.
    The Grouping works fine -- the query returns the TAG_PERIOD_START_DATE, just not the value of the function.
    BTW, this query works in SQL Plus (with the quotes removed, of course).
    Thanks for any suggestion you may have.

    When I just made a change to the SQL, I got a message stating:
    You have requested to change the Interactive Report query. If you added columns to the query, they will not be displayed when the report is run. You will need to use the actions menu and either select the columns or click Reset. If you removed any columns from the query, it will disable existing filters, highlight rules, and other report settings referencing those columns. Please confirm your request.
    So maybe that was the cause of the problem yesterday. Where is the "Actions menu"?

  • Cs6 issue with still frame duration setting not working, possibly yosemite problem

    Hi, I moved my project over to my iMac, which I updated to Yosemite awhile back. Suddenly the frame duration for stills setting defaults to 5 even though it is set at 2 for my animation project. What gives?
    I just bought my master collection two years ago and spent a pretty penny. There were updates for the Mavericks update but none for Yosemite? I think there need to be and people spend too much money on these products for the support option to be so skimpy.
    Hopefully someone answers this issue with a solution. Otherwise, I will not speak highly of Adobe.

    As suggested by someone on a different forum, I tried downgrading the firmware to 7.6.1. By doing so, the problems disappeared and WPA2 only mode works correctly. I will file a bug report with Apple.

  • JMenuBar causes setExtendedState(Frame.MAXIMIZED_BOTH) to not work?

    Hello folks,
    I'm trying to teach myself Java Swing and I'm going through the tutorials and trying to create little applications as a learning process.
    Originally, my intent for this little dummy application of mine was for it to load up maximized. After some searching, I found that you can use setExtendedState(Frame.MAXIMIZED_BOTH);
    This worked great until I wanted to create a menu bar. I added JMenuBar and it seems to nullify what I had done before with the setExtendedState.
    The problem seems to be with frame.pack();
    If I remove the pack function then the screen starts out maximized with the menu bar. If I add it in, then the screen loads up fitted, and when minimized, the frames seem to have no width/height.
    Can someone please give me some advice on how I could load up the screen maximized with the menu bar? And when unmaximized (but not minimized), the screen has a reasonable width/height?
    Thanks in advance.

    HI ,
    Actually i also have the same problem, i am creating a gui with four splits . i want the frame to extend to the maximum position when maximize is clicked.
    plz help me out what to use actually to make my screen flexible to minimum nd maximum positions.
    thanks
    swathi.

  • Fit Frame to Shortcut not working in Indesign CC

    Have tried deleting my preferences and making sure there were no system keyboard shortcuts that had the same keystrokes. Any other ideas?

    It's working for me in InDesign CC on the same operating system.
    Here's a couple ideas:
    Make sure there's not a Mac OS X system shortcut already set to this shortcut. Go to System Preferences > Keyboard Shortcuts and check all the tabs for existing system shortcuts (I didn't find any but maybe you had set one). InDesign CC now gives preference to the system.
    You could also try restoring your InDesign preferences.

  • HELP ADOBE AS3! Playing frame twice is not working

    okay so I'm almost done with my website, but i got really stuck on the last part.
    i have a main page that works perfectly wen i just open my site, in it are buttons that takes me to three other minor pages, there are buttons in the minor pages that takes you back to the main page. when i click on these buttons and get i succesfully get to the mainpage, the codes don't work anymore and i cant click on the buttons to go to the minor pages :S!!! WHAT IS THE PROBLEM :'(.. it works in the begining and then it does't this doesnt make sense:
    this is the code i use:
    stop();
    buttons.buttonmotion.addEventListener(MouseEvent.CLICK, klk);
    function klk(event:MouseEvent):void {
    gotoAndPlay("motionreal");
    stop();
    buttons.buttonmodeling.addEventListener(MouseEvent.CLICK, hhh);
    function hhh(event:MouseEvent):void {
    gotoAndPlay("modelingreal");
    stop();
    buttons.buttonprint.addEventListener(MouseEvent.CLICK, kjk);
    function kjk(event:MouseEvent):void {
    gotoAndPlay("printreal");
    stop();
    buttons.buttonweb.addEventListener(MouseEvent.CLICK, lkk);
    function lkk(event:MouseEvent):void {
    gotoAndPlay("webreal1");
    stop();
    buttons.buttonaboutme.addEventListener(MouseEvent.CLICK, sos);
    function sos(event:MouseEvent):void {
    gotoAndPlay("aboutmereal");

    i tried making it go back the the mainpage by frame number and by label, and it actually does but the codes don't work anymore, and the codes are on top of that frame number and label name. i have the mainpage and other pages, all inside a movieclip.. called "masterclip" could that be the problem?
    my buttons are inside two movieclips, could that be the problem?
    im desperate for help ive been trying to finish my website for 3 months now, thats crazy!!!
    thanks for the reply , i hope u can solve me problem

  • Region Printing Not Working

    Can anyone help with this problem?
    I am setting up region printing output as follows:
    Under PRINT ATTRIBUTES
    (1) Enable Report Printing = YES
    (2) Output Format = DERIVE FROM PAGE ITEM (based on LOV that returns PDF, RTF, XLS, HTM)
    (3) Item = P90_FILE_TYPE (based on LOV)
    (4) Under Report Columns, I ensure that only columns shown in report are checked and that the checked columns add up to exactly 100%.
    I don't understand why sometimes I get data and other times I don't while the queries on the screen have data.
    My queries on the report are working, but when I click the print link, it generates empty files. Sometimes with only a header, other times with a 0 byte length file (no header at all).
    Any help would be appreciated.
    Thanks,
    Randy

    Hi,
    What print sever are you using (BI Publisher or third-party like Apache FOP)? Out of the box, only BI Publisher supports Word, Excel and HTML. Using Apache FOP, you can only generate PDF. Also, your output format selection needs to be applied to session state first, i.e. page needs to be submitted prior to clicking the print link. This has been extended in APEX 3.1 (currently available as hosted beta), so you can actually have an item to pick the output format and click the print link without having to submit the page first.
    Regards,
    Marc

  • Anchored Frame BorderWidth change - not working

    Hello,
    I have wrote a script to change the BorderWidth of the Anchored Frame to 0.3pt. However, It does not modify BorderWidth as expected. Could you please guide me what am I doing wrong?
    var flow = doc.MainFlowInDoc;    
    var frame = 0;    
    var elementContainer = 0;
    var parentElementContainer = 0;
    var anchoredFrames = flow.GetText(Constants.FTI_FrameAnchor);     
    for (var i = 0; i < anchoredFrames.len; i += 1)    
         frame = anchoredFrames[i].obj;        
         elementContainer = frame.Element.ElementDef.Name;       
          parentElementContainer = frame.Element.ParentElement.ElementDef.Name;               
          if (parentElementContainer == "Figure")           
               frame.BorderWidth = "557314";      // Frame Border Width = 0.3pt, for all kind of parent elements   
    Regards,
    Ankit Shah

    Hi Kirk,
    Ultimately I am trying to conform to PAL. My project was shot on a Canon 5D MK2 at 30 fps. I'm currently using Sony Vegas to do my edit which has been completed.
    I dont really like the look of how vegas drops frames when I set it to 25 fps so I wanted to see how quicktime treated the frame rate conversion but when I change the setting it seems to have no effect.

  • I cannot print from firefox. I can print from open office. It seems to have something to do with when frames open because in IE, I can print a whole page, but when I try to use a print button embeded in a page or frame it does not work.

    Cannot print from firefox at all.
    In Internet Explorer, I was able to print by pushing the print button, but when opening a frame, like in mapquest, the embedded print button brings up an options window that has print frames options in it, but when hit OK in this box, a second error box comes up with a yellow exclamation point and nothing prints. I have a feeling that it is the same problem with both browsers, but would prefer using firefox. Can you help with this?

      Yes, I tried that.   The files were ordered by their original numbers as imported from the camera, but I batched them through Phocoshop to downsize all of them into a more manageable file size.   I opened that destination folder from quick time  from where it said select image sequence.   I clicked on the first one and opened it.   The result was a large image with an arrow indicating a movie was ready to go.   When I pressed the arrow, though, I realized it had only imported that one frame so there was no movie.   The files are Jpgs and are about 450 KB each. 
        To your knowledge are there any links to iMovie tutorials or quick time tutorials that may address this situation?  Maybe there will be one I haven't looked at yet. 
        Thanks

  • Adobe website very slow: Changing region does not work.

    I change my region to South Africa English as the USA server takes forever to respond. I am hoping this will make it
    faster. However, every time I click it defaults back to USA even though I set it to remember my location.
    Image of what I do below:

    Same with me: My settings for "Germany - German" are always lost. Even worse: when I go to the captivate wish form and change the region setting, then I am thrown to the homepage of Adobe in Germany - but I would have expected to get the wish form in German language.

  • BLOB download from report region in translated application does not work

    We created an application (APEX 3.1.2) with a base language dutch (300) and a translated application en-uk (3001). The problem is that in the translated application downloading BLOB's from a report region does not work and results in an error (page cannot be found).
    The query source for the region is:
    select naam
    , dbms_lob.getlength(bestand)
    , mimetype
    from bos_documentatie
    The column 'dbms_lob.getlength(filename)' is defined as a 'BLOB Download Format Mask' with the following setting:
    DOWNLOAD:BOS_DOCUMENTATIE:BESTAND:NAAM::MIMETYPE:FILENAME:::attachment:Open
    The URL's to the BLOB documents are different between the dutch and en-uk application:
    dutch:
    http://nldvnr01ux002:7792/pls/xvapexd/apex_util.get_blob?s=4260101889649158&a=300&c=12455124581749125&p=1001&k1=Application Multi Language.doc&k2=&ck=A24A5EA6903C5A9603B86D30F128F4DE&rt=CR
    en-uk:
    http://nldvnr01ux002:7792/pls/xvapexd/apex_util.get_blob?s=4260101889649158&a=300&c=12455124581749125.3001&p=1001&k1=Application Multi Language.doc&k2=&ck=7FF0C64FDD48A4D7A6892CFB2B6BCA57&rt=CR
    As you can see the c parameter for the en-uk version has a '.3001' at the end, the internal ID of the translated application. I don't know if this can be the cause of the problem?

    Hi Peter,
    Thanks for the suggestion. However we have a lot of APEX applications build in that same APEX version (one development database) and upgrading now to a higher APEX version would mean we would have to re-test all our applications and upgrade all our test and production environments, just for this bug. And, maybe the higher APEX version may not solve our problem.
    Thanks and regards,
    Patrick

  • When i did my last update of Firefox from 3.6 to the version before 5.0 Frame 2.0 did not work. Have you solved this problem in the new version?

    When i upgraded Firefox from version 3.6 to the next version I got a message about Frames that did not work. I work as a warehouse manager and we use an application called LogTrade when we ship goods. LogTrade was not working with the version after 3.6, I think it was 4.0? I had to reinstall 3.6 to get it working. Since LogTrade is essential for my work I don't know if I dare to upgrade to version 5.0.

    You can try this extension to override compatibility issues,
    * https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/

Maybe you are looking for