From: Mike Williams on
"mayayana" <mayaXXyana1a(a)mindXXspring.com> wrote in message
news:iPNKg.5797$xQ1.1813(a)newsread3.news.pas.earthlink.net...
>
> Actually I did mean LoadPicture. I still haven't
> tried LoadImage. I gather that you mean a 24-bit
> BMP or JPG on 16-bit display will get loaded by
> LoadPicture as 16-bit and get distorted? (Is that
> what the debate was about? I didn't catch that.)

Yes. That was it. By the way, I'm sorry I haven't got time to answer your
other points (just about to leave for a little holiday) but I think you'll
find some good Jpeg to DIBSection code on the vbAccelerator site. As you
say, most systems these days run at 32 bit so on those systems LoadPicture
will be just fine, but there are still quite a few systems running at 16
bit.

Mike


From: Schmidt on

"Mike Williams" <Mike(a)WhiskyAndCoke.com> schrieb im Newsbeitrag
news:%23FJcTJhzGHA.4116(a)TK2MSFTNGP02.phx.gbl...

> Although you didn't specifically say so, the clear implication (as
> reinforced below) was that you were saying the VB method of
> loading the jpeg into a StdPicture object would not degrade the
> colour quality on a system ...

Yep, but if your argumentation is based on an implication, then you
should have also accepted his implicit concession about your point:
;-)
"I was loading a 24-bit bitmap running at 16-bit without a reboot,
so those results may not have been entirely accurate..."
Sounds as clear as "Yes you're right, I was wrong" to me.

Could have lived well without the following posts. ;)

Anyway, thanks for pointing that out (was new to me too).

Olaf


From: Larry Serflaten on

"mayayana" <mayaXXyana1a(a)mindXXspring.com> wrote

> A followup on VBAccelerator: It turns out that
> there's a project there by Steve McMahon,
> vbImageProc2, that uses a custom routine
> to resize. I don't know what to make of this,
> as compared to StretchBlt. Any opinions,
> anyone? I'm pasting it below because it's
> fairly compact.

That's compact? For compact resize code, have a look below:

<g>
LFS

Option Explicit
Const TestFile = "D:\temp\einstein.jpg"

Private Sub Form_Paint()
Dim pic As StdPicture
Set pic = LoadPicture(TestFile)
DrawImage Me.hDC, pic, 100, 80, 0.75
DrawImage Me.hDC, pic, 50, 40, 0.5
DrawImage Me.hDC, pic, 0, 0, 0.25
End Sub

Private Sub DrawImage(ByVal DestDC As Long, ByRef Source As StdPicture, Optional X As Single = 0, Optional Y As Single = 0,
Optional Scaled As Single = 1)
Dim wid As Single, hgt As Single
wid = ScaleX(Source.Width * Scaled, vbHimetric, vbPixels)
hgt = ScaleY(Source.Height * Scaled, vbHimetric, vbPixels)
Source.Render (DestDC), X, Y + hgt - 1, wid, -hgt, 0, 0, Source.Width, Source.Height + ScaleY(1, vbPixels, vbHimetric), 0
End Sub





From: Larry Serflaten on

"mayayana" <mayaXXyana1a(a)mindXXspring.com> wrote

> A followup on VBAccelerator: It turns out that
> there's a project there by Steve McMahon,
> vbImageProc2, that uses a custom routine
> to resize. I don't know what to make of this,
> as compared to StretchBlt. Any opinions,
> anyone? I'm pasting it below because it's
> fairly compact.

That's compact? For compact resize code, have a look below:

<g>
LFS

Option Explicit
Const TestFile = "D:\temp\einstein.jpg"

Private Sub Form_Paint()
Dim pic As StdPicture
Set pic = LoadPicture(TestFile)
DrawImage Me.hDC, pic, 100, 80, 0.75
DrawImage Me.hDC, pic, 50, 40, 0.5
DrawImage Me.hDC, pic, 0, 0, 0.25
End Sub

Private Sub DrawImage(ByVal DestDC As Long, ByRef Source As StdPicture, Optional X As Single = 0, Optional Y As Single = 0,
Optional Scaled As Single = 1)
Dim wid As Single, hgt As Single
wid = ScaleX(Source.Width * Scaled, vbHimetric, vbPixels)
hgt = ScaleY(Source.Height * Scaled, vbHimetric, vbPixels)
Source.Render (DestDC), X, Y + hgt - 1, wid, -hgt, 0, 0, Source.Width, Source.Height + ScaleY(1, vbPixels, vbHimetric), 0
End Sub





From: Mike Williams on
"Schmidt" <sss(a)online.de> wrote in message
news:ei75QNB0GHA.4228(a)TK2MSFTNGP06.phx.gbl...

> Sounds as clear as "Yes you're right, I was wrong" to me
> [Mike Sutton's "so those results may not have been entirely
> accurate"]. Could have lived well without the following posts. ;)
> Anyway, thanks for pointing that out [LoadPicture to StdPicture
> colour depth problem] (was new to me too).

I agree that it could have been left there Olaf, and as far as I am
concerned it would have been except for the fact that in his next post Mike
Sutton said, "Unless your system is (again) operating differently to all
mine". His statement might look rather innocuous at first glance, but there
is history on this one Olaf, which you may not know about. Mike Sutton was
effectively calling me a liar, just as he has done in the past. That's what
got my back up. I was not lying then and I am not lying now. I am NOT a
liar. Mike Sutton's phrase, "yadda, yadda yadda" and his statement that I
was merely "regurgitating a load of rubbish" didn't help matters either,
especially as I was doing no such thing. Mike, as I'm sure everyone here
knows, is a top notch expert when it comes to graphics and I have a great
respect him and for his abilities, but I don't like anyone calling me a
liar. If I say something happens in a specific manner on my own system then
that is exactly what it does. As far as I am concerned the matter rests
here, unless I am again called a liar, in which case I shall respond
appropriately.

Mike Williams
MVP Visual Basic