Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problems with Picture as background in VB6 form

Posted on 2003-10-31
5
Medium Priority
?
1,210 Views
Last Modified: 2013-12-03
Hi,
   I am trying to use a picture created using MS Paint (BMP) as background for the form. I noticed difference, when I run the same app on laptop and PC. If I size the form for the size of bitmap picture on laptop, it looks perfect on the laptop, but when I run the same app on a desktop, the picture looks streteched and as wll as clipped, so total picture is not shown as it is bigger than form size. I tried all the resolutions on the Desktop, the effect is same.
   The otherway also it is same. If I design / compile the form on the PC to the size of bitmap it looks perfect on Desktop, but when I run on laptop, it looks shrunk and picture background is smaller than the form size.
   what am I missing here? What things I need to consider when using bitmap / jpeg / gif picture as background in the forms, and need to run the application on laptops as well as desktops.
Help is appreciated.

Thanks,
Kumar
0
Comment
Question by:ktalinki
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Dang123
ID: 9660248
Are you running the same OS on both the desktop and laptop?

0
 
LVL 9

Expert Comment

by:Dang123
ID: 9660275
Do you have the same color depth set on both?
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9660375
Do you have the same screen resolution? (800x600, 1024x728 and so on)
0
 
LVL 15

Accepted Solution

by:
ameba earned 2000 total points
ID: 9662440
You are using Large Fonts setting in Display Properties of your PC.

1) Use Small Fonts on all computers
2) Prepare 2 bitmaps, and load the right one, depending on user's font setting
3) If bitmap looks OK when scaled, draw the background picture so it covers the whole form:

Private Sub Form_Load()
    Dim px As Single
    On Error Resume Next
   
    px = Screen.TwipsPerPixelX
    If px = 15 Then
        ' user is using normal fonts
        Set Me.Picture = LoadResPicture(4, vbResBitmap)
    Else
        ' user is using large fonts
        AutoRedraw = True
        Call PaintPicture(LoadResPicture(4, vbResBitmap), 0, 0, ScaleWidth, ScaleHeight)
    End If
End Sub


Note:
If Screen.TwipsPerPixelX is 15 - user is using normal fonts
If it's 12 - user is using Large fonts
Other values - user is using scaled font size.

If you use gif or other compressed picture format, loading might be slow.  I suggest bmp, stored in res file or in app directory.
0
 
LVL 15

Expert Comment

by:ameba
ID: 9692567
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question