Fabien Comte Posted April 16, 2018 Report Posted April 16, 2018 Hello, I have a custom draw with image for buttons and labels and it looks like if x y havec an offset of +1 to +3 pixels (difficult to evaluate). Do you have an idea ?
Joel Bodenmann Posted April 16, 2018 Report Posted April 16, 2018 Well, you gotta give us more than just that. We can't just guess out of nothing. Please include a screenshot (with a reference to what the size of one pixel is) and a text file with your custom drawing function.
Fabien Comte Posted April 23, 2018 Author Report Posted April 23, 2018 Hello, When i draw my images, it looks like x and y are expected values + 2 This is the code void gwinMyButtonCustomDraw(GWidgetObject *gw, void *param) { const GColorSet * pcol; coord_t sy = 0; if (gw->g.vmt != (gwinVMT *)&buttonVMT) return; gdispImage * temp_images = (gdispImage *)param; gdispImage * temp_image = NULL; if (!(gw->g.flags & GWIN_FLG_SYSENABLED)) { temp_image = &(temp_images[BUTTON_DISABLED]); } else if ((gw->g.flags & GBUTTON_FLG_PRESSED)) { temp_image = &(temp_images[BUTTON_ACTIVE]); } else { temp_image = &(temp_images[BUTTON_IDLE]); } gdispGImageDraw(gw->g.display, temp_image, gw->g.x, gw->g.y, gw->g.width, gw->g.height, 0, sy); if (gw->text[0] != '\0') { pcol = getButtonColors(gw); gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, justifyCenter); } } And a schematic (i noticed that because my button image was a prolongation of the background)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now