tailieunhanh - O’Reilly Learning OpenCV phần 3

trackbars cho tất cả những điều thông thường người ta có thể làm với một thanh trượt cũng như những bất thường (xem phần tiếp theo, "Không có nút") Như với cửa sổ cha mẹ, thanh trượt cho một tên duy nhất (trong các hình thức của một chuỗi ký tự) và sau đó luôn luôn được gọi bằng cái tên đó. Những thói quen để tạo ra một trackbar HighGUI là: | trackbars for all of the usual things one might do with a slider as well as many unusual ones see the next section No Buttons As with the parent window the slider is given a unique name in the form of a character string and is thereafter always referred to by that name. The HighGUI routine for creating a trackbar is int cvCreateTrackbar const char tcackrar_nare const char WindoW_name Vial ralue Itt thunt CaTracintrTallback on_change k The IT vol Ibvoargumnn In arethename for the trackbar itself and the name of the parent window towhirh ton trackbar win be attached. When the trackbar is created it is added to eh hka t So n ssop so n s o e o ottom of the parent window it will not occlude any image that is alre ady rn thr window The next two arguments are value a pointer to an integer that will be set automatically to rhe cviIujIo which aCct sO iderhas o aro movrd and ccont a ni iTOtraO vakietor rhe maximum value of ths rlidet. vvr sari h1 v vomterto a ttat 11 v b -bb b whenever the slider is moved. This is exactly analogous to the callback for mouse events. If used oha callback Í Linnalii n must have ttta form tvaracOboT CtllTack wli irSiiu deCned as voie _castc tti i at v Hú cc uc ck i_nvC ad uaiio required so if you don t want a callback then you can sim-plyset thĩT bdluo hv tiutc. WhtOoutacdUbetd ihd only a fSeta oVthe ostd mating shectider milObr the VO lue oT valre Ore tog changed. Horllp 0 ere ere iw_ more routinet eo at win ulow you to progremmabcanyro l ar read the valunoi altdf kbnrii you knaw its name lit. .cvCCiTradtatoo- coast thar rrackbar_natr catol thar aindrs_ncno vtid 0 13 00 anfdt ahaef anfdt ahaef tracobi_name ũrt arr n . These functions allow you to set or read the value of a trackbar from anywhere to your program. Whenherin ns nnnnn to lib top or bottom depends on the operating system but it will always appear in the same place on any given platform. 100 I Chapters HighGUI No Buttons Unfortunately HighGUI does .

TỪ KHÓA LIÊN QUAN