Hi all. This is my first post to the forum. I am struggling to find good examples of Picture.FormatJPEG and Picture.QualityMax that fit in my code. I have an extensive Application that uses a number of JPEGS. I am losing resolution when I scale my pictures down, so I am hoping that proper use of QualityMax or QualityHigh would fix this. Note I am not resaving the pictures, so I am not concerned with the “lossy” nature of jpegs.
This is the area of code in question:
pic = New Picture(ButtonPic(i).Width * factor, ButtonPic(i).Height * factor, 32)
pic.graphics.DrawPicture ButtonPic(i), 0, 0, pic.width, pic.height, 0, 0, ButtonPic(i).width, ButtonPic(i).height
Button(i).Icon = pic
And I originally read my jpeg file off of disk here:
picFile = GetFolderItem(…)
ButtonPic(i) = Picture.Open(picFile)
I am struggling to find good examples of Picture.FormatJPEG
This happens only at image file open time (as you wrote later in your post.
Xonsider JPEG (and others like PNG, etc.) as a user file format. In memory, the things are different (Picture).
I am losing resolution when I scale my pictures down
I think this is (more or less) included in the process.
What you do not disclose is the code to create the lower sized Picture to hold your smaller image.
I notice that you do not specify a Resolution at pic Picture creation.