{"id":28386880,"url":"https://github.com/dennisliu1993/blackjack","last_synced_at":"2025-07-24T07:08:27.570Z","repository":{"id":119094308,"uuid":"532373615","full_name":"DennisLiu1993/BlackJack","owner":"DennisLiu1993","description":"Using MFC to create a BlackJack game platform","archived":false,"fork":false,"pushed_at":"2022-09-30T08:29:38.000Z","size":12115,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T15:51:17.966Z","etag":null,"topics":["blackjack","cbuttonst","cpp","doublebuffer","mfc","userinterface"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DennisLiu1993.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-03T21:04:31.000Z","updated_at":"2024-11-29T02:24:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"456d7b5b-d9aa-4779-9ef1-60bfc4709df1","html_url":"https://github.com/DennisLiu1993/BlackJack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DennisLiu1993/BlackJack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisLiu1993%2FBlackJack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisLiu1993%2FBlackJack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisLiu1993%2FBlackJack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisLiu1993%2FBlackJack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DennisLiu1993","download_url":"https://codeload.github.com/DennisLiu1993/BlackJack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DennisLiu1993%2FBlackJack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266807161,"owners_count":23987426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blackjack","cbuttonst","cpp","doublebuffer","mfc","userinterface"],"created_at":"2025-05-30T15:39:00.058Z","updated_at":"2025-07-24T07:08:27.560Z","avatar_url":"https://github.com/DennisLiu1993.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlackJack\nUsing MFC to create a BlackJack game platform\n\n# What Techniques Used in This Project\n1. **double buffer drawing** strategy in MFC to prevent controls or numbers from blinking (see OnPaint ())\n2. usage of **CButtonST** (Image Button with features of **transparent background** and no border) \n3. OpenCV **perspective tranform** to show slanted cards (see WarpPespective ())\n4. dynamically show number changes (see code when win or lose)\n5. **dealing cards animation**\n\n# Interface\n![image](https://user-images.githubusercontent.com/104763587/188288051-1a41785f-8329-4320-9ca6-277cc1948388.png)\n\n# Demo Gif\n![image](https://github.com/DennisLiu1993/BlackJack/blob/main/BlackJack/BlackJack.gif)\n\n# How to Build\n1.\tDownload Visual Studio 2017 or newer versions\n2.\tCheck on the option of \"x86 and x64 version of C++ MFC\"\n3.\tInstall\n4.\tOpen BlackJack.vcxproj\n5.\tUpgrade if it is required\n6.\tOpen this project's property page\n7.\tChoose the SDK version you have in \"General-Windows SDK Version\"\n8.\tChoose the right toolset you have in \"General-Platform Toolset\" (for me, it is Visual Studio 2017 (v141))\n9.\tGo to \"C/C++ - General\", and type in \"Additional Include Directories\" for your own OpenCV include headers (e.g. C:\\OpenCV3.1\\opencv\\build\\include or C:\\OpenCV4.0\\opencv\\build\\include)\n11.\tType in \"Library Directories\" for your own OpenCV's library path (the directory where your opencv_worldXX.lib locates)\n12.\tGo to \"Linker-Input\", and type in library name (e.g. C:\\OpenCV3.1\\build2017_worldx64\\lib\\opencv_world310d_vs2017_x64.lib)\n13.\tMake sure that your opencv_worldXX.dll and is in the same directory as .exe of this project (after building)\n\n# Extentions\nWith Perspective Tranform, we can make the animation of deal more fluent and sophistocated.\n\nIf we want to build a full action of flipping cards, we need to divide this action into several steps.\n\nFor instance, now I break flipping cards into 20 actions with 20 different perspective matrix:\n\nIn this way, showing all cards continually can simulate the action of flipping\n\n![2](https://user-images.githubusercontent.com/104763587/188575917-806237ab-1918-4f6d-b32d-9834fbcf6663.jpg)\n![3](https://user-images.githubusercontent.com/104763587/188575931-00db9670-9c5b-4729-9e52-c25a78f3c66a.jpg)\n![4](https://user-images.githubusercontent.com/104763587/188575933-2f38e80f-93f1-47ce-b647-eda11ca15c5a.jpg)\n![5](https://user-images.githubusercontent.com/104763587/188575935-768acafc-80da-4b40-9170-90207f42df79.jpg)\n![6](https://user-images.githubusercontent.com/104763587/188575938-21c20297-5794-47b0-afde-7a3ca9578f23.jpg)\n![7](https://user-images.githubusercontent.com/104763587/188575941-0ba6d4c4-878b-46ff-9787-0af49ab9798c.jpg)\n![8](https://user-images.githubusercontent.com/104763587/188575946-f83b76e9-30fe-4042-b4c3-6ce0294fb503.jpg)\n![9](https://user-images.githubusercontent.com/104763587/188575949-2068043c-8de0-488f-ac38-976a2222c869.jpg)\n![10](https://user-images.githubusercontent.com/104763587/188575950-a8302702-ccef-4165-9a12-b958db2a1e8e.jpg)\n![11](https://user-images.githubusercontent.com/104763587/188575954-f5a280b9-7c5b-406d-8e16-dccd10ae2c89.jpg)\n![12](https://user-images.githubusercontent.com/104763587/188575957-d6e3c397-b6c8-4ab4-8309-70e47b945731.jpg)\n![13](https://user-images.githubusercontent.com/104763587/188575958-c802ad1c-7fec-4e5c-9be8-0a7b0c7b2935.jpg)\n![14](https://user-images.githubusercontent.com/104763587/188575959-7d224321-7d85-4a44-81f8-d29363e1cb51.jpg)\n![15](https://user-images.githubusercontent.com/104763587/188575960-527780cd-ebda-4894-864d-272248e6160c.jpg)\n![16](https://user-images.githubusercontent.com/104763587/188575965-4bfd50f9-78b9-414c-8b61-b63acb559552.jpg)\n![17](https://user-images.githubusercontent.com/104763587/188575969-f789481f-eebf-463d-bd32-12d58c762180.jpg)\n![18](https://user-images.githubusercontent.com/104763587/188575973-0d93cfe8-c8bb-454d-88e8-fe7f75df4cfc.jpg)\n![19](https://user-images.githubusercontent.com/104763587/188575976-ba97626a-dda2-4e39-a35a-0b0e13a1bd6c.jpg)\n\ncode to output images like this:\n\n```\nPoint2f vecLT2RT = PLAYER_CARD1_RT - PLAYER_CARD1_LT;\nPoint2f vecLB2RB = PLAYER_CARD1_RB - PLAYER_CARD1_LB;\nfor (int i = 1; i \u003c 20; i++)\n{\n\tMat matShow = m_matShow.clone ();\n\tm_ptsPlayerOne[0] = PLAYER_CARD1_LT + vecLT2RT / 40 * i;//LT\n\tm_ptsPlayerOne[1] = PLAYER_CARD1_RT - vecLT2RT / 40 * i;//RT\n\tm_ptsPlayerOne[2] = PLAYER_CARD1_LB + vecLT2RT / 40 * i;//LB\n\tm_ptsPlayerOne[3] = PLAYER_CARD1_RB - vecLT2RT / 40 * i;//RB\n\tMat matAction = getPerspectiveTransform (m_ptsTableTop, m_ptsPlayerOne);\n\twarpPerspective (m_matHoleCard, matShow, matAction, m_matTableTop.size (), 1, BORDER_TRANSPARENT);\n\tstring s = format (\"C:\\\\users\\\\user\\\\Downloads\\\\%d.jpg\", i);\n\timwrite (s, matShow (rect));\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisliu1993%2Fblackjack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdennisliu1993%2Fblackjack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdennisliu1993%2Fblackjack/lists"}