mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-18 18:22:01 +08:00
Allow images in higher resolution to be stored in own folder
- The is an alternative used in other toolkits
This commit is contained in:
committed by
Vadim Zeitlin
parent
5881cc3d29
commit
c0bbcd2c71
@@ -232,7 +232,8 @@ public:
|
||||
Create a bundle from bitmaps stored as files.
|
||||
|
||||
Looking in @a path for files using @a filename as prefix and potentionally a
|
||||
suffix with scale, e.g. "_2x" or "@2x"
|
||||
suffix with scale, e.g. "_2x" or "@2x". Alternatively, it will look for
|
||||
files with the same filename in a directory "2.0x/" (@since 3.3.2).
|
||||
|
||||
@param path Path of the directory containing the files
|
||||
@param filename Bitmap's filename without any scale suffix
|
||||
|
||||
@@ -529,6 +529,12 @@ wxBitmapBundle wxBitmapBundle::FromFiles(const wxString& path, const wxString& f
|
||||
fn.SetName(wxString::Format("%s_%dx", filename, dpiFactor));
|
||||
}
|
||||
|
||||
if ( !fn.FileExists() && dpiFactor != 1 )
|
||||
{
|
||||
// try /2.0x/image.png naming scheme
|
||||
fn.AppendDir( wxString::Format("%d.0x", dpiFactor));
|
||||
}
|
||||
|
||||
if ( fn.FileExists() )
|
||||
{
|
||||
wxBitmap bmp(fn.GetFullPath(), wxBITMAP_TYPE_ANY);
|
||||
|
||||
Reference in New Issue
Block a user