|
Thanks for all that info.
The fact is right now I am in a sort of anti-PNG attitude for some personal-job-related reasons
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
|
Thanks MarkKuk
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nish [BusterBoy] wrote:
What's wrong with JPG,BMP,GIF???
Why do people want PNG all of a sudden?
I dunno about png ( although a lot of people put it forward as a replacement for gif ), but Unisys own the patent to the compression used in gif, so any code that uses gif requires payment of royalties. That is what killed gif online.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
> Isn't there native support for PNG in Windows?
No (not directly in the Win32 SDK, GDI, or MFC), but there is in GDI+...
Peace!
-=- James.
|
|
|
|
|
not entirely true... the latest BITMAPINFOHEADER specs include the option of a PNG or JPG encoded data in addition to the old formats.
-c
Smaller Animals Software, Inc.
|
|
|
|
|
> not entirely true... the latest BITMAPINFOHEADER specs include the option of a
> PNG or JPG encoded data in addition to the old formats.
You are correct... For the in-memory representation of the images, but for loading and saving of PNG (or JPEG for that matter) files? My guess is that is what the OP meant by "native support": the ability to easily load and save a PNG file just as easily as calling "::LoadImage( <pathtobmpfile> ):.
I know that ImportImage(...) does, but that requires an add-on (DirectX/DirectAnimation) to Windows.
Peace!
-=- James.
|
|
|
|
|
Hi I would like to know if anybody can help me out here.
I want to create a transparent Image By Performing all operation on a Memory dc.
This Is what I have done so far and it works ..The only problem is that I do not know how to initialise the Bitmap which is selected into the memory DC
My current code is as folllows..
DrawTrans(CDC* pDC, COLORREF crColor)
{
COLORREF m_crWhite = RGB(255,255,255);
COLORREF m_crBlack = 0;
COLORREF crOldBack = pDC->SetBkColor(m_crWhite);
COLORREF crOldText = pDC->SetTextColor(m_crBlack);
COLORREF crOldBkMode = pDC->SetBkMode(TRANSPARENT);
// Create two memory dcs for the image and the mask
CDC dcTrans, dcImage;
CDC dcFinal;
CBitmap bmpFinal;
bmpFinal.CreateCompatibleBitmap(pDC,ImageWidth, nImageHeight);
dcFinal.CreateCompatibleDC(pDC);
dcImage.CreateCompatibleDC(pDC);
dcTrans.CreateCompatibleDC(pDC);
//m_PImageInfoData is structure contaiing
BITMAPINFO bmpInfo;
/*char* */ BYTE* pszData;
int nImageWidth = m_pImageInfoData->bmpInfo.bmiHeader.biWidth;
int nImageHeight = m_pImageInfoData->bmpInfo.bmiHeader.biHeight;
int nUsage = DIB_RGB_COLORS;
// Create the mask bitmap
CBitmap bitmapTrans, bitmapImage;
bitmapImage.CreateCompatibleBitmap(pDC, ImageWidth, nImageHeight);
bitmapTrans.CreateBitmap(nImageWidth, nImageHeight, 1, 1, NULL);
CBitmap* pOldBitmapImage = dcImage.SelectObject(&bitmapImage);
// Select the mask bitmap into the appropriate dc
CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans);
CBitmap *pOldBmp = dcFinal.SelectObject(&bmpFinal);
StretchDIBits(dcImage.GetSafeHdc(), 0, 0, nImageWidth, nImageHeight, 0, 0, nImageWidth, nImageHeight, m_pImageInfoData->pszData,
&(m_pImageInfoData->bmpInfo),
DIB_RGB_COLORS, SRCCOPY);
dcImage.SetBkColor(crColor);
// Build mask based on transparent colour
dcTrans.BitBlt(0, 0, nImageWidth, nImageHeight,
&dcImage,
0, 0, SRCCOPY);
dcFinal.StretchBlt(0, 0, nImageWidth, nImageHeight,
&dcImage,
0, 0,
nImageWidth, nImageHeight, SRCINVERT);
dcFinal.StretchBlt(0, 0, nImageWidth, nImageHeight,
&dcTrans,
0, 0, nImageWidth, nImageHeight,
SRCAND);
dcFinal.StretchBlt(0, 0, nImageWidth, nImageHeight,
&dcImage,
0, 0,
nImageWidth, nImageHeight,
SRCINVERT);
pDC->StretchBlt(0, 0, nImageWidth, nImageHeight,
&dcImage,
0, 0,
nImageWidth, nImageHeight,
SRCCOPY);
// Restore settings
dcTrans.SelectObject(pOldBitmapTrans);
dcImage.SelectObject(pOldBitmapImage);
dcFinal.SelectObject(pOldBmp);
bitmapTrans.DeleteObject();
bitmapImage.DeleteObject();
bmpFinal.DeleteObject();
pDC->SetBkMode(crOldBkMode);
pDC->SetTextColor(crOldText);
pDC->SetBkColor(crOldBack);
dcFinal.DeleteDC();
dcTrans.DeleteDC();
dcImage.DeleteDC();
This code works perfectly fine except for the garbage values that are displayed bcoz the Bitmap is not initialized...I would like to know what i can do to initialse the bitmap to NULL ...
Thanks ...
Clemence
|
|
|
|
|
I would like to know what i can do to initialse the bitmap to NULL
BitBlt and BLACKNESS.
/Mike
|
|
|
|
|
BOOL TransparentBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int hHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
UINT crTransparent // color to make transparent
);
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Doesn't work under Windows 95.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
hello,
Im not sure why but VS keeps locking up on me.
The following code Compiles,links and executes if it is a Win32 Console App:
DWORD dwHigh,dwLow;
__asm
{
rdtsc
mov dwLow, eax
mov dwHigh, edx
}
However if this is a windowed app, MFC app it will lock up at various times, while running cl.exe or while linking.
rdtsc moves the Time Stamp counter into the above registers
why does this lock VS up while compiling???
|
|
|
|
|
Please elaborate. Is it VC that is "locking up" on you, or is it the app that "will lock up at various times"? You state both alternatives, and somehow I find this hard to believe. What does "lock up" mean? Attach the debugger to your hung exe and see where it's hung.
Are you using a single or multi-CPU system? Remember that the TSC is CPU bound. Also keep in mind that you should serialize the CPU if doing any FP operations in proximity of this call (e.g. CPUID with EAX = 0).
/Mike
|
|
|
|
|
VS locks up on me as a stated.
Visual Studio itself "locks up" during compiling.
If i go to the task manager it states Visual sutdio is not responding . however it is using about 99% of the processor.
I guesse the compiler is in a loop but i dont understand how those three lines of code could put it in a loop.
As well as i stated. It will work perfect in a console only app.
Any type of windowed app.. MFC or just old win32 API will lock the COMPILER up.
Im not doing any floating point ops.
Basicly if i use the app wiard and make a generic MFC dialog app and i insert this code anywhere in the premade code. . InitDialog(), OnButton() where ever i put this code will lock VS up.
Im running an AMD 500 on XP home editition.. VS Enterprise. .with service packs.
|
|
|
|
|
i did try this on another machine. AMD 900. .
and it works fine. ..
guesse it something with the hardware. . or maybe i got to reinstall.
|
|
|
|
|
I want to do something (minimize to tray) when a user hits my window's standard normal Minimize button on the title bar of the window. How do I trap this minimize box and call my tray functions instead?
-Jason
nirgle.bitdevil.com
|
|
|
|
|
|
My prog seems to get that right off the bat after loading. I assume that's normal? Any quick way to ensure that it's the user that clicked the minimize box and not some internal MFC or Windows thing?
-Jason
nirgle.bitdevil.com
|
|
|
|
|
maybe in your first ShowWindow you are passing SW_MINIMIZE as the nCmdShow parameter.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hello everybody!
Who knows, what codes are generated with multimedia and the Internet keys of keyboards?
If for different keyboards they various where to take the utility for viewing the codes generated by the keyboard!
Best regards,
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
Hi,
Is there any way to get the name of the font file for a given font along with its attributes like bold, italic, etc.?
Thanks,
Krishnan
|
|
|
|
|
GetTextMetrics often gives you all you need to know about a font. Why would you want to know a fonts filename?
/Mike
|
|
|
|
|
Mike Nordell wrote:
GetTextMetrics often gives you all you need to know about a font. Why would you want to know a fonts filename?
I have requirement to get the list of all fonts I am using in my application so that I can bundle them with my software.
|
|
|
|
|
I'm working on a project that will allow a trace window in release mode, by extending IOStream functionality. Rather than have people have to learn my new modifiers, etc., I am also writing macros to replace TRACE for different circumstances. I want to have a trace window per file, and a global one. I also want a variable watch window, so I can send a variable in such a way that instead of scrolling off in the trace window, it stays visible.
My problem is I'd like to define a macro so I can do something like
VARTRACE(myVariable);
and have the macro pass both the variable and it's name to the stream. Is there a way I can pass the name of the variable given to the macro as an argument ?
Thanks.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I may be totally off base here, but I think you are looking for the ## token pasting operator.
---
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|