Win32 - how delete some Region points?

i have 1 Region:
HRGN hRgn = CreateRectRgn(0,0,wBmpWidth,wBmpHeight);
heres how i remove some points:
if (pixelcolor==backcolor)
SetWindowText(ActivatedForm,"match");
// remove transparent color from region
hTmpRgn = CreateRectRgn(x,y,x+1,y+1);
CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
DeleteObject(hTmpRgn);
i belive that the CombineRgn() isn't right, because the points aren't removed :(
what can advice me?

finally it's working:
BYTE* Get24BitPixels(HBITMAP pBitmap, WORD *pwWidth, WORD *pwHeight)
// a bitmap object just to get bitmap width and height
BITMAP bmpBmp;
// pointer to original bitmap info
LPBITMAPINFO pbmiInfo;
// bitmap info will hold the new 24bit bitmap info
BITMAPINFO bmiInfo;
// width and height of the bitmap
WORD wBmpWidth, wBmpHeight;
// get some info from the bitmap
GetObject(pBitmap, sizeof(bmpBmp),&bmpBmp);
pbmiInfo = (LPBITMAPINFO)&bmpBmp;
// get width and height
wBmpWidth = (WORD)pbmiInfo->bmiHeader.biWidth;
wBmpWidth -= (wBmpWidth%4); // width is 4 byte boundary aligned.
wBmpHeight = (WORD)pbmiInfo->bmiHeader.biHeight;
// copy to caller width and height parms
*pwWidth = wBmpWidth;
*pwHeight = wBmpHeight;
// allocate width * height * 24bits pixels
BYTE *pPixels = new BYTE[wBmpWidth*wBmpHeight*3];
if (!pPixels) return NULL;
// get user desktop device context to get pixels from
HDC hDC = GetWindowDC(NULL);
// fill desired structure
bmiInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmiInfo.bmiHeader.biWidth = wBmpWidth;
bmiInfo.bmiHeader.biHeight = -wBmpHeight;
bmiInfo.bmiHeader.biPlanes = 1;
bmiInfo.bmiHeader.biBitCount = 24;
bmiInfo.bmiHeader.biCompression = BI_RGB;
bmiInfo.bmiHeader.biSizeImage = wBmpWidth*wBmpHeight*3;
bmiInfo.bmiHeader.biXPelsPerMeter = 0;
bmiInfo.bmiHeader.biYPelsPerMeter = 0;
bmiInfo.bmiHeader.biClrUsed = 0;
bmiInfo.bmiHeader.biClrImportant = 0;
// get pixels from the original bitmap converted to 24bits
int iRes = GetDIBits(hDC,pBitmap,0,wBmpHeight,(LPVOID)pPixels,&bmiInfo,DIB_RGB_COLORS);
// release the device context
ReleaseDC(NULL,hDC);
// if failed, cancel the operation.
if (!iRes)
delete pPixels;
return NULL;
// return the pixel array
return pPixels;
HRGN ScanRegion(HBITMAP pBitmap,COLORREF clrTransparent )
BYTE jTranspR = GetRValue(clrTransparent), jTranspG=GetGValue(clrTransparent), jTranspB=GetBValue(clrTransparent);
// bitmap width and height
WORD wBmpWidth,wBmpHeight;
// the final region and a temporary region
HRGN hRgn, hTmpRgn;
// 24bit pixels from the bitmap
BYTE *pPixels = Get24BitPixels(pBitmap, &wBmpWidth, &wBmpHeight);
if (!pPixels) return NULL;
// create our working region
hRgn = CreateRectRgn(0,0,wBmpWidth,wBmpHeight);
if (!hRgn) { delete pPixels; return NULL; }
// scan the bitmap
DWORD p=0;
for (WORD y=0; y<wBmpHeight; y++)
for (WORD x=0; x<wBmpWidth; x++)
BYTE jRed = pPixels[p+2];
BYTE jGreen = pPixels[p+1];
BYTE jBlue = pPixels[p+0];
if ((jRed == jTranspR && jGreen == jTranspG && jBlue == jTranspB))
// remove transparent color from region
hTmpRgn = CreateRectRgn(x,y,x+1,y+1);
CombineRgn(hRgn, hRgn, hTmpRgn, RGN_XOR);
DeleteObject(hTmpRgn);
// next pixel
p+=3;
// release pixels
delete pPixels;
// return the region
return hRgn;
if(inst->blnTransparent==true)
TransparentBlt(test.hdc,0,0,imglabel.width(),imglabel.height(),imglabel,0,0, imglabel.width(),imglabel.height(), inst->clrBackColor);
inst->LabelRegion=ScanRegion(imglabel, inst->clrBackColor);
SetWindowRgn(inst->hwnd,inst->LabelRegion,TRUE);
else
SetWindowRgn(inst->hwnd,NULL,TRUE);
BitBlt(test.hdc,0,0,imglabel.width(),imglabel.height(),imglabel,0,0,SRCCOPY);
inst is the subclass pointer;
imglabel is the image class object.
maybe you can't see the diference... sorry. but works fine now.
thanks for all

Similar Messages

  • I can not delete some power point files in the trash.help?

    I can not delete some power point files in the trash.help?

    Hi Gary,
    The presentations were created originally with PowerPoint. I have been using them on both KeyNote and PowerPoint with no problem, even after updating to MountainLion. Problems started at the 10.8.3 upgrade. The installation was an upgrade form Lion. Yes I mean Open Office, I am able to open the presentation with Open Office and play it with no problems.
    The presentation gets loaded by Power Point and the Power Point freezes. Key Note can not even load it. Stops 3/4 of the way. This happens with ALL my presentations.
    I want to thank you for your help.
    Leonardo

  • How delete a cut point in fcpx if it was done earlier in project?

    Hi,
    I'm learning FCPX, but I can't find out how to simply eliminate/delete a cut/an edit point that I made earlier.
    I know how to delete a cut point when it is simply my previous edit, but when I'm many edits down the line and want to go back and eliminate an earlier cut, how to do it?
    In Final Cut 7, it was an easy right click to a submenu.  Thanks, Duncan

    Jim, Tom and Ian, Thanks for your replies. I think I miscommunicated what I'm after. In Final Cut Pro 7, one could go back to an earlier cut mark that had been inserted, but no actual cut between clips had been made.
    Then one could just right click to get a list which had the option to "Join Through Edits", and eliminate that cut mark as if it never existed. This was helpful to me, as I often used it to mark potential edits as I went along. I started marking potential cuts that way in FCP X, but then couldn't find a way to erase them.
    I apologize for not being clear. Jim, I will have to try your suggestion.You're right that functionally you can get to the same end. I just liked the quick ability that was there in FCP 7.
    Thank you all.
    Duncan

  • How delete access point in n8

    i want to delete some access point internet connection

    yeh i deleted all acces points an dstill there are some  but where? why it keeps telling me its in use when is not?
     where is it?  this nokia sis bloody  complicated   horrible !!!
    that  on top is there but where i find those o2mms payandgo and o2 pay ad go  why its not deleted??
    Attachments:
    DSC01433.JPG ‏83 KB

  • Iphoto: How to safely delete or move photos.  I have over 7000 photos.  When I deleted some, I found that the event still shows up with a blank frame.  Can I move some photos to an external hard drive but leave the pointer in iphoto?

    iphoto: How to safely delete or move photos.  I have over 7000 photos.  I would really like to move tsome of the older photos to an external hard drive. (They are backed up in Time Machine, but I like the immediacy of having them available.)  So question 1 -  is it possible to split the iphoto library so that the directory tree points to an external drive in some cases?  And if that doesn't work--I am willing to export and delete some of these photos.  However, an earlier delete left me with events that have a name in the event folder, but no photos.  Question 2 -- How do I properly delete photos so that all references disappear?
    example:

    Warning: Time Machine is not an Archiving application. It keeps rolling back ups. That means if you delete something from the source Mac it will eventually be also deleted from Time Machine. How long that takes depends on the amount of disk space TM has. So, remember, backing up in Time Machine is not the same as Archiving.
    For the blank thumbnails: This can happen if you try delete too many photos at one go. Experienced users suggest you should delete in batches of 100 or so.
    Yes you can split the Library, where some of the Masters are stored locally and some on an external disk, but really, you don't want to do that. iPhoto's file management tools are limited at best, and if the path to the files changes then you could find yourself repairing the links to the files - all of them, one by one.
    Better: Have your entire Library on an External Drive.
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    If you want to have a smaller library on your internal disk:
    Here's one way to do what you want:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    Now you have two full versions of the Library.
    3. On the Internal library, trash the Events you don't want there
    Now you have a full copy of the Library on the External and a smaller subset on the Internal
    Some Notes:
    As a general rule: when deleting photos do them in batches of about 100 at a time. iPhoto can baulk at trashing large numbers at one go.
    You can choose which Library to open: Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Choose Library'
    You can keep the Library on the external updated with new imports using iPhoto Library Manager
    Regards
    TD

  • I was deleting some Wild Tangent games, computer went nuts, and now I can't get Firefox. I have to access the web through Internet Explorer (hate it). How do I get Firefox back. I've tried everything.

    I had FF 4.0 Beta 12. While deleting some Wild Tangent games, everything went black and I haven't been able to get to Firefox since, (about 7-8 weeks. I click on the desktop icon for FF and I do get the FF screen with the FF icon on top left and the minimize, maximize and exit icons on the top right. However, the screen is just white and I can't open anything up. This is driving me crazy because the only way I can get to the internet is through IE and I hate it. I do get a crash report from FF and I fill it out and send it in with my email but I hear nothing from FF because I don;t think you get the report. I want my FF back and I'm going very frustrated trying everything and nothing works. Please, please help me if you can. Thanks, Cathy

    Forgot Your Account Password
    For Lion, Mountain Lion, or Mavericks
        Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
         When the menubar appears select Terminal from the Utilities menu.
         Enter resetpassword at the prompt and press RETURN. Follow
         instructions in the dialog window that will appear.
         Or see:
           Reset a Mac OS X 10.7 Lion Password
           OS X Mountain Lion- Reset a login password,
           OS X Mavericks- Solve password problems,
           OS X Lion- Apple ID can be used to reset your user account password.
    For Snow Leopard and earlier with installer DVD
         Mac OS X 10.6- If you forget your administrator password,
         OS X- Changing or resetting an account password (Snow Leopard and earlier).
    For Snow Leopard and earlier without installer DVD
        How to reset your Mac OS X password without an installer disc | MacYourself
        Reset OS X Password Without an OS X CD — Tech News and Analysis
        How To Create A New Administrator Account - Hack Mac

  • How to delete some pages in a document in pages without deleting all the pages

    How do I delete some pages in a document?  I have 7 pages listed and I want to delete the last two pages of the document and when I do the thumbnail to delete the pages it wants to delete all the pages in the document.

    akaLegal wrote:
    Thanks Peter,
    Yes, I just wanted to tell Jerrold that I tried his suggestion and it worked.  I tried many times until I came across his suggestion.  As far, as my comment about the points, I thought there was a way to rate the responses and the person providing the response would receive some points from Apple.  (See the Legend banner above discussing points).  If I am correct in this assessment, I just wanted to ensure he got credit for solving my problem.
    Have a great day!  Thanks for responding!
    Lora
    Lora,
    I appreciate the feedback. The Points issues aside, if you had posed your question in a new thread, your use of the Solved tag would alert others searching the Discussions that you had a positive result. This thread, Marilyn not having marked it, doesn't stand out as a solved one. Maybe Marilyn is satisfied, and maybe not. It would be nice to know.
    Jerry

  • HT201774 How do I delete excess email messages from my iPhone.  There are 300 messages listed, and every time I delete some, more are added from old messages.  How do I limit the number of messages that can appear on my phone?  How can I delete messages i

    How do I delete excess email messages from my iPhone.  There are 300 messages listed, and every time I delete some, more are added from old messages.  How do I limit the number of messages that can appear on my phone?  How can I delete messages in bulk,

    You can't.
    All photos transferred from your computer are stored in the Photo Library. The photos in the album or albums below are not duplicates - they include a pointer to the original photos stored in the Photo Library. This way you can view the photos in a particular album only by selecting the album, or you can view all photos available in all albums by selecting Photo Library.
    Just as with an iTunes playlist. A song cannot be in an iTunes playlist unless the song is in the main iTunes library. Placing a song in a playlist does not duplicate the song. Remove the main iTunes library or the songs from the main iTunes library that are in a playlist and the songs will no longer be in the playlist either. This way you can listen to the songs in the playlist only by selecting the playlist, or all songs in your entire iTunes library by selecting Music under Library in the iTunes source list.
    The same with iPhoto on a Mac. A photo cannot be in an in iPhoto Event or Album unless the photo is in the main iPhoto library. Placing a photo in an Event or Album does not duplicate the photo. This way you can view the photos in an iPhoto Event or Album only by selecting the Event or Album, or all photos in all Events or Albums.

  • I have an iphone  4 8gig there is 2.4 gig of "other" showing on my usage which is more than all oter data on the phone.  What is it and how do I delete some to clear space?

    I have an iphone 4 8gig there is 2.4 gig of "other" showing on my usage which is more than all other data on the phone.  What is it and how do I delete some to clear space?

    Sorry. We can't help you. It's no longer an iPhone. Apple won't touch it.
    Take it to whoever replaced the screen and see if they can help you.
    iPhones are not user servicable and Apple does not sell iPhone parts at all. I'd be surprised if you were actually able to back it up at this point. It sounds like it's completely borked.

  • How to join regions without deleting notes in the right region.

    How to join regions without deleting notes in the right region?
    Every time I try to join two regions, the notes in the right region are cut, even though both regions are on the same track and are touching each other. 
    This is so frustrating. I searched on some other sites and Garageband Help section, but for some bizarre reason, I can't find any explanation of this basic topic.
    Tony

    Tony, the two Regions in your screenshot (green, yellow) are Take Regions (they have a Take number in the reft upper corner), which are Regions that contain multiple Regions and you can select any one to be the active (played) Region. You cannot merge those Regions. You have to delete the unwanted Regions inside first. click on the number, select the Region you want and then click again and select "Delete unused Takes"
    If you don't want to create Take Regions, select the "Cycle Recording" checkbox in the Preferences ➤ General Window
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • How do I view the songs on my iPod and how do I delete some songs and pictures that are on my iPod through the new iTunes

    I just bought an iPod off of a friend andher ex put alot of terrible music and pictures on it and I want to delete some music but I can't see what is on The iPod through the iTunes so I can erase music. So all I wanna know is how do I see and erase the stuff on my iPod using iTunes on my lab top

    If you have iTunes 11 on your laptop then you can enable the left-hand sidebar on it via option-command-S on a Mac, control-S on a PC. You should then be able to connect the iPod and it should show on that left-hand sidebar, and underneath it should be a Music section e.g. similar to :
    Select that and the music should be shown on the right-hand side of iTunes, which you can then use to delete it.
    You should be able to remove all content from the iPod directly on it via Settings > General > Reset > Erase All Content And Settings, as any apps etc that are on it will be tied to the previous owner's id - that will also remove any photos from the iPod

  • I have deleted some drivers and am trying to reinstall these - how?

    HELP. I ran a cleaning program a while ago, and it seems I deleted some system files and drivers. My computer has had problems and listed some missing drivers i.e.: isapno.sys combatt.sys BATTC.SYS aliide.sys PCIIDEX.SYS pcmcia.sys Mount.sys and many more I wrote them down when my computer wouldn't start and displayed these as I tried to open in safe mode and latest configuration that worked. I am afraid to restart my computer in case it wont start up again.
    I am desperately trying to download the missing drivers.
    1) How do install the missing drivers?
    Furthermore I can not use my external CD drive - it says "E: Drive is inaccesible" I have tried to download the drivers for memorex DVD+R inorder to make a bakcup of my files - but failed -under device settings I only find Samsung drive and not memorex (my drive is called Storix Optical Series)
    2) How do I get my CD drive/burner to work ?
    Ps It works for playing CD's but not burning or opening blanc CD's
    If anyone can Help me I would be so pleased!
    Sincerely,
    Amanda

    Hello
    In some cases it is not easy to make the operating system running well again. I agree with Nicky. First thing that you can try is to use System restore tool and try to rollback the operating system to earlier time before the problem occur.
    The easiest way to make your system functional again is to reinstall it with recovery DVD. On this way the system will be clean installed and everything should works again. If you decide to do this you can create two partitions (expert mode) and second one use for data saving.

  • Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files but still have them on the TC for future reference..

    Okay so I set up my Time Capsule already and is now backing up 2 of my iMacs. Works great. What I want to know is how to use the TC to directly store files? I want to do this to delete some files on iMac 20inch but still have them on the TC for future reference..eg some movies on iTunes. I want to directly save them on the drive so I can delete them from iTunes and gain some storage. (Ps on iMac 20 inch (it's almost full - 320 GB) when I enter time machine, a tab comes up on finder which reads "Time Machine backups" it's able to be ejected like a disc or a connected device. On the iMac 20 inch, I dragged some files onto there as if using it like a hard drive. Is this the correct method? Then I went to my 27inch iMac and saw the "Time Machine Backups" hoping to see the files I dragged from the 20inch iMac. But the files were not there except a folder that said "Backups.backupdb". Can someone help me?

    It's not a good idea to use a network disk for both Time Machine backups and other things.  By design Time Machine will eventually consume all the space on its output disk, which will then cause problem for your other files.  I'd store those other files on an external disk connected to the Time Capsule.  The problem with that is that Time Machine will only back up files that are local to your Mac.  That means that you'll only have one copy of the files on or attached to your Time Capsule.
    By the way, you've been misled by poor field labeling on this forum into typing a large part of your message into the field intended for the subject.  In the future just type a short summary of your post into that field and type the whole message into the field below that.

  • How can I delete some music from my iCloud but not from my iTunes in my computer? please??

    how can I delete some music from my iCloud but not from my iTunes in my computer? please??

    iCloud doesn't store your music.

  • How can i delete some books from ibook?

    How can i delete some books from ibook? It says: this book can't be opened. The book is corrupt. I can't open and I can't delete it

    I was unable to delete a book sample from my iPhone 5s running iOS 7.  This seems to be what worked for me.  I went to the Library and clicked "edit" in upper right side of the screen.  I then tapped one time on the book I wanted to remove and a blue check appeared at the bottom right corner of that book (presumably you could tap several at a time)  Anyway, when the blue check is on the book, you will see in the upper left of the screen the word "Delete" (mine was in red) I clicked that and then a confirming dialog came up from the bottom of the screen with the choices of "delete" or "cancel".  I chose "delete" and the book was gone.  Hope this helps.

Maybe you are looking for

  • Images sent from Lightroom 5 won't appear in Elements 12

    About one month ago I've bought and installed on my computer Photoshop Elements 12. However since then I had never launched the programme, which I did for the first time yesterday by trying to send five TIFF shots from Lightoroom 5.4 to Elements (Pho

  • JPA  -  tree structure mapping    with toplink essential

    I'll try to explain it correctly. I store a tree structure in a database. I have just two tables: Node which contain a id , and some other info. Tree which contain a parent and child parent and child are ids from node. Since each node can have severa

  • ChaRM: Support of more than one transport layer

    Hi! We would like to implement ChaRM for the 3 tier landscape (DEV:100 --> QAS:200 --> PRD:100) with several transport layers and transport routes: a) u201CZDEVu201D u2013 Standard transport layer b) u201CSAPu201D u2013 SAP transport layer c) u201CYC

  • Leopard Latency?

    Hello. Unlike the recent post concerning rendered files disappearing: I am having the opposite problem of rendered files appearing. E.g., I render out a 16bit tiff file and if I import back into Shake, the file is empty. If I try to import into photo

  • Can user Reset the Password without Administrator help in MS Exchange server 2013

    Hi Team  IT is possible  for user to reset the password in MS Exchange server 2013 without Administrator help? (by getting mobile verification code how we get in Gmail ,& Outlook )    if it is possible ,kindly send me the configuration URL to my Mail