+ _bitmap.reset (new wxBitmap (_cropped_image));
+
+ for (list<SubtitleView>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) {
+ Rectangle sub_rect (i->position.x, i->position.y, i->image.GetWidth(), i->image.GetHeight());
+ Rectangle cropped_sub_rect = sub_rect.intersection (cropped);
+
+ cout << "sub " << sub_rect.x << " " << sub_rect.y << " " << sub_rect.w << " " << sub_rect.h << "\n";
+ cout << "cropped " << cropped_sub_rect.x << " " << cropped_sub_rect.y << " " << cropped_sub_rect.w << " " << cropped_sub_rect.h << "\n";
+
+ i->cropped_image = i->image.GetSubImage (
+ wxRect (
+ cropped_sub_rect.x - sub_rect.x,
+ cropped_sub_rect.y - sub_rect.y,
+ cropped_sub_rect.w,
+ cropped_sub_rect.h
+ )
+ );
+
+ i->cropped_image.Rescale (cropped_sub_rect.w * x_scale, cropped_sub_rect.h * y_scale, wxIMAGE_QUALITY_HIGH);
+
+ i->position = Position (
+ cropped_sub_rect.x * x_scale,
+ cropped_sub_rect.y * y_scale
+ );
+
+ cout << "scales are " << x_scale << " " << y_scale << "\n";
+ cout << "scaled to " << (cropped_sub_rect.w * x_scale) << " " << (cropped_sub_rect.h * y_scale) << "\n";
+
+ i->bitmap.reset (new wxBitmap (i->cropped_image));
+ }