http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&feed=atom&action=history
Saving JPEGs with GDI plus - Revision history
2024-03-29T11:07:38Z
Revision history for this page on the wiki
MediaWiki 1.22.2
http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&diff=2747&oldid=prev
Dee: Reverted edit of AlvarBoela, changed back to last version by Dee
2008-07-18T16:05:36Z
<p>Reverted edit of AlvarBoela, changed back to last version by Dee</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 16:05, 18 July 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">capasdro</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Uses GDI+ API (Standardly resident only in Windows XP, but available [http://www.microsoft.com/downloads/details.aspx?FamilyID=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en here] for other versions of Windows)</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Uses GDI+ API (Standardly resident only in Windows XP, but available [http://www.microsoft.com/downloads/details.aspx?FamilyID=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en here] for other versions of Windows)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Dee
http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&diff=2734&oldid=prev
Spammer-AlvarBoela: vilatale
2008-07-14T21:30:24Z
<p>vilatale</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 21:30, 14 July 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">capasdro</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Uses GDI+ API (Standardly resident only in Windows XP, but available [http://www.microsoft.com/downloads/details.aspx?FamilyID=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en here] for other versions of Windows)</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Uses GDI+ API (Standardly resident only in Windows XP, but available [http://www.microsoft.com/downloads/details.aspx?FamilyID=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en here] for other versions of Windows)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Spammer-AlvarBoela
http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&diff=2416&oldid=prev
Dee: SaveJPG moved to Saving JPEGs with GDI plus
2006-06-20T07:51:27Z
<p><a href="/SaveJPG" class="mw-redirect" title="SaveJPG">SaveJPG</a> moved to <a href="/Saving_JPEGs_with_GDI_plus" title="Saving JPEGs with GDI plus">Saving JPEGs with GDI plus</a></p>
<table class='diff diff-contentalign-left'>
<tr style='vertical-align: top;'>
<td colspan='1' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black; text-align: center;">Revision as of 07:51, 20 June 2006</td>
</tr><tr><td colspan='2' style='text-align: center;'><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Dee
http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&diff=2405&oldid=prev
Breadman at 02:43, 20 June 2006
2006-06-20T02:43:25Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 02:43, 20 June 2006</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Uses GDI+ API (Standardly resident only in Windows XP, but available [http://www.microsoft.com/downloads/details.aspx?FamilyID=6A63AB9C-DF12-4D41-933C-BE590FEAA05A&displaylang=en here] for other versions of Windows)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">This example usage saves Picture1 to "C:\x.jpg" with 50% image quality:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> SaveJPG(Picture1, "C:\x.jpg", 50)</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Put the following code in a module and call to SaveJPG() in order to save an StdPicture to a JPG.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Option Explicit</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Option Explicit</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 90:</td>
<td colspan="2" class="diff-lineno">Line 97:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     End If</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>     End If</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>End Sub</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>End Sub</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></pre></ins></div></td></tr>
</table>
Breadman
http://hashvb.earlsoft.co.uk/index.php?title=Saving_JPEGs_with_GDI_plus&diff=2404&oldid=prev
Breadman at 02:31, 20 June 2006
2006-06-20T02:31:12Z
<p></p>
<p><b>New page</b></p><div>Option Explicit<br />
<br />
' ----==== API Declarations ====----<br />
<br />
Private Type GUID<br />
Data1 As Long<br />
Data2 As Integer<br />
Data3 As Integer<br />
Data4(0 To 7) As Byte<br />
End Type<br />
<br />
Private Type GdiplusStartupInput<br />
GdiplusVersion As Long<br />
DebugEventCallback As Long<br />
SuppressBackgroundThread As Long<br />
SuppressExternalCodecs As Long<br />
End Type<br />
<br />
Private Type EncoderParameter<br />
GUID As GUID<br />
NumberOfValues As Long<br />
Type As Long<br />
Value As Long<br />
End Type<br />
<br />
Private Type EncoderParameters<br />
Count As Long<br />
Parameter As EncoderParameter<br />
End Type<br />
<br />
Private Declare Function GdiplusStartup Lib "GDIPlus" (token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As Long<br />
Private Declare Function GdiplusShutdown Lib "GDIPlus" (ByVal token As Long) As Long<br />
Private Declare Function GdipCreateBitmapFromHBITMAP Lib "GDIPlus" (ByVal hbm As Long, ByVal hPal As Long, Bitmap As Long) As Long<br />
Private Declare Function GdipDisposeImage Lib "GDIPlus" (ByVal Image As Long) As Long<br />
Private Declare Function GdipSaveImageToFile Lib "GDIPlus" (ByVal Image As Long, ByVal filename As Long, clsidEncoder As GUID, encoderParams As Any) As Long<br />
Private Declare Function CLSIDFromString Lib "ole32" (ByVal str As Long, id As GUID) As Long<br />
<br />
' ----==== SaveJPG ====----<br />
<br />
Public Sub SaveJPG(ByVal pict As StdPicture, ByVal filename As String, Optional ByVal quality As Byte = 80)<br />
Dim tSI As GdiplusStartupInput<br />
Dim lRes As Long<br />
Dim lGDIP As Long<br />
Dim lBitmap As Long<br />
' Initialize GDI+<br />
tSI.GdiplusVersion = 1<br />
lRes = GdiplusStartup(lGDIP, tSI)<br />
<br />
If lRes = 0 Then<br />
<br />
' Create the GDI+ bitmap<br />
' from the image handle<br />
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap)<br />
<br />
If lRes = 0 Then<br />
Dim tJpgEncoder As GUID<br />
Dim tParams As EncoderParameters<br />
<br />
' Initialize the encoder GUID<br />
CLSIDFromString StrPtr("{557CF401-1A04-11D3-9A73-0000F81EF32E}"), _<br />
tJpgEncoder<br />
<br />
' Initialize the encoder parameters<br />
tParams.Count = 1<br />
With tParams.Parameter ' Quality<br />
' Set the Quality GUID<br />
CLSIDFromString StrPtr("{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"), .GUID<br />
.NumberOfValues = 1<br />
.Type = 4<br />
.Value = VarPtr(quality)<br />
End With<br />
<br />
' Save the image<br />
lRes = GdipSaveImageToFile( _<br />
lBitmap, _<br />
StrPtr(filename), _<br />
tJpgEncoder, _<br />
tParams)<br />
<br />
' Destroy the bitmap<br />
GdipDisposeImage lBitmap<br />
End If<br />
<br />
' Shutdown GDI+<br />
GdiplusShutdown lGDIP<br />
End If<br />
<br />
If lRes Then<br />
Err.Raise 5, , "Cannot save the image. GDI+ Error:" & lRes<br />
End If<br />
End Sub</div>
Breadman