c++ - I want to draw a rectangle on an image at given pixel location using wxWidgets -


i want add rectangle on image. rectangle starts position , size based on pixels of image . suppose have image of resolution 100x100 , want draw rectangle 25x25 50x50 (i.e 25th pixel in both horizontal , vertical 50th pixel). , when resize image new pixels info should updated , rectangle should across same image previously.

consider group photo having x ,y,z in them , know pixel info of x in picture @ full resolution should draw rectangle on x , when user resizes image rectangle should still focus on x irrespective of pixel info.

int neww, newh; dc.getsize(&neww, &newh);

if (neww != w || newh != h) {     resized = wxbitmap(image.scale(neww, newh , wximage_quality_high));     w = neww;     h = newh;     dc.drawbitmap(resized, 0, 0, false);     dc.setpen(wxpen(*wxlight_grey, 2));     dc.setbrush(*wxtransparent_brush);     dc.drawrectangle(wxpoint(352,78), wxsize(50, 50)); } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -