Current filter:
                                You should refresh the page.
                                  • My images are stored in a Resource File as PNG graphics. When I load them into a TcxButton they are clear. When I load them into a Wizard Control Button they are blurry. See attached pictures.

                                    Code for Button Load

                                    [Delphi]
                                    procedure LoadButtonGraphic(const AButton: TcxButton; const ResourceType, ResourceName: string); var xBitMap: VCL.Graphics.TBitMap; xImage : TdxSmartImage; begin xImage := TdxSmartImage.Create; try if ResourceName <> '' then begin xImage.LoadFromResource( hInstance, ResourceName, PCHAR( ResourceType ) ); xBitMap := xImage.GetAsBitmap; AButton.OptionsImage.Glyph.Assign( xBitMap ); xBitMap.FreeImage; end; finally FreeAndNil( xImage ); FreeAndNil( xBitMap ); end;

                                    Code for Wizard Button Load

                                    [Delphi]
                                    procedure LoadWizardButtonGraphic(const AButton: TdxWizardControlCustomButton; const ResourceType, ResourceName: string ); var xBitMap: VCL.Graphics.TBitMap; xImage : TdxSmartImage; begin xImage := TdxSmartImage.Create; try if ResourceName <> '' then begin xImage.LoadFromResource( hInstance, ResourceName, PCHAR( ResourceType ) ); xBitMap := xImage.GetAsBitmap; AButton.Glyph.Assign( xBitmap ); xBitMap.FreeImage; end; finally FreeAndNil( xImage ); end; end;

                                    I checked and the SourceDPI is the same for both.

                                    What can I do to make the Wizard Button not be so blurry?

                                Show all comments
                                • Paulo (DevExpress Support) 06.01.2017

                                  Hello Luke,

                                  Would you please provide us with a small sample project demonstrating this behavior? This would allow us precisely replicate your scenario on our side and find an appropriate solution. I see that PNG images can be correctly assigned in our demos, so there should be a solution. Thanks in advance.

                                • Luke Miller 06.01.2017

                                  Please see the attached Sample Project. I also included a screen shot showing how it appears on my computer. The other thing I notices was that even though I am loading the same image, the graphic is smaller in the Wizard Button than in the cxButton.

                                  Please note that the graphic was purchased and thus copyrighted. Included several different sizes in case you need to test with them.

                                  Thanks in advance for your assistance.

                                • Paulo (DevExpress Support) 06.02.2017

                                  Thanks, Luke. I see that the image is correctly loaded, but in the Wizard Control's button it is automatically resized to better fit the button's size. I mean, you can set the dxWizardControl.Buttons.Common.Height property to 36 to make this image look better (just like in the TcxButton control). Moreover, I see that the focus rectangle overlaps the image in the TcxButton button. So, you can also increase the TcxButton.Height property to make the focused button look better.
                                  I have found that this image is drawn in the TdxWizardControlButtonViewInfo.DrawContent method of the dxCustomWizardControl.pas unit, so Wizard Control uses different painting routines than the TcxButton button. If you modify this method in the following manner, even resized images in your Wizard buttons should be drawn much better:

                                  [Delphi]
                                  procedure TdxWizardControlButtonViewInfo.DrawContent(ACanvas: TcxCanvas); const EnabledImageDrawModeMap: array [Boolean] of TcxImageDrawMode = (idmNormal, idmDisabled); var AOffset: TPoint; AGlyphBitmap: TBitmap; begin if not FadingHelper.DrawImage(ACanvas.Handle, Bounds) then DrawButtonBackground(ACanvas, Bounds, State); AOffset := Painter.GetButtonOffset(State); if not cxRectIsEmpty(GlyphRect) then begin if not Button.Glyph.Empty then AGlyphBitmap := Button.Glyph.GetAsBitmap else AGlyphBitmap := nil; try cxDrawImage(ACanvas.Handle, cxRectOffset(GlyphRect, AOffset), cxRectOffset(GlyphRect, AOffset), AGlyphBitmap, WizardControl.Buttons.Images, Button.ImageIndex, EnabledImageDrawModeMap[State = cxbsDisabled], True); finally AGlyphBitmap.Free; end; end; ACanvas.SaveState; try ACanvas.Font := Font; ACanvas.Font.Color := Painter.GetButtonTextColor(State); if not cxRectIsEmpty(CaptionRect) then begin cxDrawText(ACanvas, Button.Caption, cxRectOffset(CaptionRect, AOffset), DT_VCENTER or DT_SINGLELINE or DT_CENTER); end; if IsFocused then ACanvas.DrawFocusRect(Painter.GetButtonFocusRect(ACanvas, Bounds)); finally ACanvas.RestoreState; end; end;

                                  With this modification, you will be able to keep the 30 value for the dxWizardControl.Buttons.Common.Height property. I think that we can modify our source code in future builds to make this modified drawing routine default for our Wizard buttons. Please let me know your opinion.

                                • Luke Miller 06.02.2017

                                  Thank you for your observations. For now, I will just adjust the button height rather than modify the dxCustomWizardControl.pas unit.

                                  Personally, I would think that the wizard would draw the buttons the same way as cxButton does.

                                  You may close this issue and thank you again for your assistance.

                                • Luke Miller 01.24.2019

                                  Go ahead and make the content of this ticket visible. You do need to remove the attachments as they include graphics that I purchased.

                                • Paulo (DevExpress Support) 01.24.2019

                                  Thanks!

                                0 Solutions

                                Creation Date Importance Sort by