https://bugs.winehq.org/show_bug.cgi?id=56246
Bug ID: 56246 Summary: Regarding the color depth of BMP in the SavePicture method: the value is unstable. Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: win32u Assignee: wine-bugs@winehq.org Reporter: taka@bahamut7.com Distribution: ---
Created attachment 75953 --> https://bugs.winehq.org/attachment.cgi?id=75953 Difference in color depth between Wine and Windows
Thank you for the great software. In Windows 10/11, the SavePicture method saves in "24-bit color" even if the display's color setting is "32-bit color". In Wine, if the display's color setting is "32bit color", the picture is saved in "32bit color" and the Windows software throws an error. In Debian, for some reason, it is saved with the value "0". Due to this difference, some software may not work.
https://bugs.winehq.org/show_bug.cgi?id=56246
Sagawa sagawa.aki+winebugs@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sagawa.aki+winebugs@gmail.c | |om
--- Comment #1 from Sagawa sagawa.aki+winebugs@gmail.com --- Hi. Which SavePicture method are you referring to? Please provide steps to reproduce or attach a short code example if possible.
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #2 from Takahiro Yonemura taka@bahamut7.com --- Hello. VB6 through VB.net in the SavePicture method of the VBS. In a 32 bit color depth setting Run "Me.SavePicture PictureBox.picture/image." On Windows (for some reason) it is saved as a 24 bit BMP file. Wine creates a 32 bit BMP file or a 0 byte blank file.
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #3 from Sagawa sagawa.aki+winebugs@gmail.com --- Can you share a link for the executable to examine?
I think what you are talking about is SavePicture statement [1]. I guess the statement internally calls OleSavePictureFile Win32 API. However, Wine's OleSavePictureFile is a stub [2], i.e. it does nothing.
Regarding your topic, SavePicture creates a file and stores an incorrect color depth value. This means that my assumption may be wrong. Since I don't have a VB6 compiler, I need an executable that uses SavePicture to investigate.
[1] https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basi...) [2] https://gitlab.winehq.org/wine/wine/-/blob/wine-9.0/dlls/oleaut32/olepicture...
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #4 from Takahiro Yonemura taka@bahamut7.com --- Created attachment 75966 --> https://bugs.winehq.org/attachment.cgi?id=75966 VB6 verification code and executable files.
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #5 from Takahiro Yonemura taka@bahamut7.com --- Here is the source code of the form in the attached Zip file. The source code is to load "300DummyBMP.bmp" (300*300 white BMP file) into the picture box, draw a rectangle and save it as "test.bmp". The "test.bmp" becomes a blank file (0KB) (Debian 64bit) or a BMP file with 32bit color depth (Ubuntu 64bit). I would appreciate it if this could be verified. --------
VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4095 ClientLeft = 60 ClientTop = 450 ClientWidth = 5790 LinkTopic = "Form1" ScaleHeight = 4095 ScaleWidth = 5790 StartUpPosition = 3 'Windows の既定値 Begin VB.CommandButton Command1 Caption = "Command1" Height = 615 Left = 3840 TabIndex = 1 Top = 1680 Width = 1455 End Begin VB.PictureBox P1 AutoRedraw = -1 'True Height = 2895 Left = 360 ScaleHeight = 2835 ScaleWidth = 3075 TabIndex = 0 Top = 360 Width = 3135 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False
Private Sub Command1_Click() P1.Picture = LoadPicture(App.Path + "\300DummyBMP.bmp") P1.Line (0, 0)-(100, 100), 0, BF P1.Picture = P1.Image SavePicture P1.Picture, "test.bmp" End Sub
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #6 from Sagawa sagawa.aki+winebugs@gmail.com --- Thanks to your demo, I can confirm the issue with Wine 9.1 Staging.
From my testing, your application calls IPicture::SaveAsFile(). In vanilla Wine, it creates an empty file. This issue is filed as Bug 8532.
Your issue seems to be in the Wine-Staging patch. Please update the Product column to Wine-Staging, not Wine. You can verify whether you're running vanilla or staging by running "wine --version" command in your terminal.
https://bugs.winehq.org/show_bug.cgi?id=56246
--- Comment #7 from Sagawa sagawa.aki+winebugs@gmail.com --- The fix has been committed as 1ee67f75a11508019b50daae0b818923be0680cd . Please try again with the next Wine Staging release, which should be 9.16 or later.