-
Jan 5th, 2021, 12:47 PM
#41
Lively Member
Re: [vb6] Enhancing VB's StdPicture Object to Support GDI+
This Class sounds very interesting. i have been using WIA for the bit of graphics i needed.
i didn't go through the whole thread, so i have just a couple of questions.
1. can i read and write the picture to a database.
2. Is it possible to load a picture (from file, resource or database) and then paint it to a DC by just using the hDC (the Device context is in memory).
-
Jan 5th, 2021, 06:54 PM
#42
Re: [vb6] Enhancing VB's StdPicture Object to Support GDI+
Originally Posted by Semke
1. can i read and write the picture to a database.
2. Is it possible to load a picture (from file, resource or database) and then paint it to a DC by just using the hDC (the Device context is in memory).
For both (1 and 2) I think the cGDIPlusCache-Class in this CodeBank-Thread is entirely sufficient:
https://www.vbforums.com/showthread....-cls-revisited
It can load from resources, and all kind of files/byte-arrays (under a given "Userdefined-ImageKey") -
and then later (alpha-)render by using that imagekey onto any target-hDC (including high-quality-scaling).
It can also convert+save e.g. a Resource loaded from an *.ico ... to a *.png-file or *.png-bytearray (for DB-Blob-storage) if that's needed.
HTH
Olaf
-
Jan 7th, 2021, 12:32 PM
#43
Lively Member
Re: [vb6] Enhancing VB's StdPicture Object to Support GDI+
Originally Posted by Schmidt
For both (1 and 2) I think the cGDIPlusCache-Class in this CodeBank-Thread is entirely sufficient:
https://www.vbforums.com/showthread....-cls-revisited
It can load from resources, and all kind of files/byte-arrays (under a given "Userdefined-ImageKey") -
and then later (alpha-)render by using that imagekey onto any target-hDC (including high-quality-scaling).
It can also convert+save e.g. a Resource loaded from an *.ico ... to a *.png-file or *.png-bytearray (for DB-Blob-storage) if that's needed.
HTH
Olaf
thanks.
this works perfect for me.
I am still struggling in saving the picture, at a reduced size
-
Jan 7th, 2021, 01:19 PM
#44
Re: [vb6] Enhancing VB's StdPicture Object to Support GDI+
I'm not aware of any graphics library where there is an atomic operation save-at-reduced-size contrary to load-at-reduced-size particularly for JPEG images (can be decoded much faster).
Your best bet would be to separate resize/resample operation from file-save operation into a two-step solution. I can see there is CreateScaledImg method.
cheers,
</wqw>
-
Jun 22nd, 2021, 03:49 AM
#45
Junior Member
Re: [vb6] Enhancing VB's StdPicture Object to Support GDI+
Hi LaVolpe,
First thanks for your amazing project and also because you always share your knowledge with others.
In the past, This project worked for me without any problems. But now, with run the project, I encounter the following error:
Code:
Run-time error '16':
Expression too complex
The error occured in the zzSafeOffset32 routine, in the flowing line:
Code:
If Abs(AdjAmount) >= UINT_MaxPlus1 Then
If I stop the project and run it again after the error occurs, the above error will no longer be displayed, but the project will not work properly. But if I close the project and run it again, I will get the same error again.
If I delete the ABS function in the error line (
Code:
If AdjAmount >= UINT_MaxPlus1 Then
), the project will work without any problems.
Do you have any idea why this error occurred? please help me.
This error occurs in the uploaded project without any changes.
I'm using Windows 10 Version 1909 Build 18363.836
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|